Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit 61724e6

Browse files
committed
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282737 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b19d280 commit 61724e6

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/Transforms/InstCombine/InstCombineSelect.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -920,28 +920,26 @@ static Instruction *foldAddSubSelect(SelectInst &SI,
920920
/// we may be able to create an i1 select which can be further folded to
921921
/// logical ops.
922922
static Instruction *foldSelectExtConst(InstCombiner::BuilderTy &Builder,
923-
SelectInst &SI, Instruction *EI,
924-
const APInt &C, bool isExtTrueVal,
925-
bool isSigned) {
926-
Value *SmallVal = EI->getOperand(0);
923+
SelectInst &SI, Instruction *ExtInst,
924+
const APInt &C, bool IsExtTrueVal,
925+
bool IsSigned) {
926+
Value *SmallVal = ExtInst->getOperand(0);
927927
Type *SmallType = SmallVal->getType();
928928

929-
// TODO Handle larger types as well? Note this requires adjusting
930-
// FoldOpIntoSelect as well.
929+
// TODO: Handle larger types? That requires adjusting FoldOpIntoSelect too.
931930
if (!SmallType->getScalarType()->isIntegerTy(1))
932931
return nullptr;
933932

934-
if (C != 0 && (isSigned || C != 1) &&
935-
(!isSigned || !C.isAllOnesValue()))
933+
if (C != 0 && (IsSigned || C != 1) && (!IsSigned || !C.isAllOnesValue()))
936934
return nullptr;
937935

938936
Value *SmallConst = ConstantInt::get(SmallType, C.trunc(1));
939-
Value *TrueVal = isExtTrueVal ? SmallVal : SmallConst;
940-
Value *FalseVal = isExtTrueVal ? SmallConst : SmallVal;
937+
Value *TrueVal = IsExtTrueVal ? SmallVal : SmallConst;
938+
Value *FalseVal = IsExtTrueVal ? SmallConst : SmallVal;
941939
Value *Select = Builder.CreateSelect(SI.getOperand(0), TrueVal, FalseVal,
942940
"fold." + SI.getName(), &SI);
943941

944-
if (isSigned)
942+
if (IsSigned)
945943
return new SExtInst(Select, SI.getType());
946944

947945
return new ZExtInst(Select, SI.getType());

0 commit comments

Comments
 (0)