[llvm] r331542 - [LoopIdiomRecognize] Don't create an IRBuilder just to call getTrue/getFalse.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri May 4 10:39:09 PDT 2018
Author: ctopper
Date: Fri May 4 10:39:08 2018
New Revision: 331542
URL: http://llvm.org/viewvc/llvm-project?rev=331542&view=rev
Log:
[LoopIdiomRecognize] Don't create an IRBuilder just to call getTrue/getFalse.
We can call the methods in ConstantInt directly. We just need a context.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp?rev=331542&r1=331541&r2=331542&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp Fri May 4 10:39:08 2018
@@ -1415,9 +1415,9 @@ bool LoopIdiomRecognize::recognizeAndIns
// %inc = add nsw %i.0, 1
// br i1 %tobool
- IRBuilder<> Builder(PH->getTerminator());
const Value *Args[] =
- {InitX, ZeroCheck ? Builder.getTrue() : Builder.getFalse()};
+ {InitX, ZeroCheck ? ConstantInt::getTrue(InitX->getContext())
+ : ConstantInt::getFalse(InitX->getContext())};
if (CurLoop->getHeader()->size() != 6 &&
TTI->getIntrinsicCost(Intrinsic::ctlz, InitX->getType(), Args) >
TargetTransformInfo::TCC_Basic)
More information about the llvm-commits
mailing list