@@ -920,28 +920,26 @@ static Instruction *foldAddSubSelect(SelectInst &SI,
920
920
// / we may be able to create an i1 select which can be further folded to
921
921
// / logical ops.
922
922
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 );
927
927
Type *SmallType = SmallVal->getType ();
928
928
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.
931
930
if (!SmallType->getScalarType ()->isIntegerTy (1 ))
932
931
return nullptr ;
933
932
934
- if (C != 0 && (isSigned || C != 1 ) &&
935
- (!isSigned || !C.isAllOnesValue ()))
933
+ if (C != 0 && (IsSigned || C != 1 ) && (!IsSigned || !C.isAllOnesValue ()))
936
934
return nullptr ;
937
935
938
936
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;
941
939
Value *Select = Builder.CreateSelect (SI.getOperand (0 ), TrueVal, FalseVal,
942
940
" fold." + SI.getName (), &SI);
943
941
944
- if (isSigned )
942
+ if (IsSigned )
945
943
return new SExtInst (Select, SI.getType ());
946
944
947
945
return new ZExtInst (Select, SI.getType ());
0 commit comments