[llvm] r282737 - fix formatting; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 10:48:19 PDT 2016


Author: spatel
Date: Thu Sep 29 12:48:19 2016
New Revision: 282737

URL: http://llvm.org/viewvc/llvm-project?rev=282737&view=rev
Log:
fix formatting; NFC

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=282737&r1=282736&r2=282737&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Thu Sep 29 12:48:19 2016
@@ -920,28 +920,26 @@ static Instruction *foldAddSubSelect(Sel
 /// we may be able to create an i1 select which can be further folded to
 /// logical ops.
 static Instruction *foldSelectExtConst(InstCombiner::BuilderTy &Builder,
-                                       SelectInst &SI, Instruction *EI,
-                                       const APInt &C, bool isExtTrueVal,
-                                       bool isSigned) {
-  Value *SmallVal = EI->getOperand(0);
+                                       SelectInst &SI, Instruction *ExtInst,
+                                       const APInt &C, bool IsExtTrueVal,
+                                       bool IsSigned) {
+  Value *SmallVal = ExtInst->getOperand(0);
   Type *SmallType = SmallVal->getType();
 
-  // TODO Handle larger types as well? Note this requires adjusting
-  // FoldOpIntoSelect as well.
+  // TODO: Handle larger types? That requires adjusting FoldOpIntoSelect too.
   if (!SmallType->getScalarType()->isIntegerTy(1))
     return nullptr;
 
-  if (C != 0 && (isSigned || C != 1) &&
-      (!isSigned || !C.isAllOnesValue()))
+  if (C != 0 && (IsSigned || C != 1) && (!IsSigned || !C.isAllOnesValue()))
     return nullptr;
 
   Value *SmallConst = ConstantInt::get(SmallType, C.trunc(1));
-  Value *TrueVal = isExtTrueVal ? SmallVal : SmallConst;
-  Value *FalseVal = isExtTrueVal ? SmallConst : SmallVal;
+  Value *TrueVal = IsExtTrueVal ? SmallVal : SmallConst;
+  Value *FalseVal = IsExtTrueVal ? SmallConst : SmallVal;
   Value *Select = Builder.CreateSelect(SI.getOperand(0), TrueVal, FalseVal,
                                        "fold." + SI.getName(), &SI);
 
-  if (isSigned)
+  if (IsSigned)
     return new SExtInst(Select, SI.getType());
 
   return new ZExtInst(Select, SI.getType());




More information about the llvm-commits mailing list