[llvm] r310062 - [InstCombine] Use ConstantInt::getFalse to reduce some code. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 09:07:18 PDT 2017


Author: ctopper
Date: Fri Aug  4 09:07:18 2017
New Revision: 310062

URL: http://llvm.org/viewvc/llvm-project?rev=310062&view=rev
Log:
[InstCombine] Use ConstantInt::getFalse to reduce some code. 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=310062&r1=310061&r2=310062&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Fri Aug  4 09:07:18 2017
@@ -447,8 +447,7 @@ static Value *foldSelectCttzCtlz(ICmpIns
     IntrinsicInst *II = cast<IntrinsicInst>(Count);
     // Explicitly clear the 'undef_on_zero' flag.
     IntrinsicInst *NewI = cast<IntrinsicInst>(II->clone());
-    Type *Ty = NewI->getArgOperand(1)->getType();
-    NewI->setArgOperand(1, Constant::getNullValue(Ty));
+    NewI->setArgOperand(1, ConstantInt::getFalse(NewI->getContext()));
     Builder.Insert(NewI);
     return Builder.CreateZExtOrTrunc(NewI, ValueOnZero->getType());
   }




More information about the llvm-commits mailing list