Skip to content

Commit

Permalink
[LoopIdiomRecognize] Don't create an IRBuilder just to call getTrue/g…
Browse files Browse the repository at this point in the history
…etFalse.

We can call the methods in ConstantInt directly. We just need a context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331542 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed May 4, 2018
1 parent dbaf52b commit 671262c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,9 +1415,9 @@ bool LoopIdiomRecognize::recognizeAndInsertCTLZ() {
// %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)
Expand Down

0 comments on commit 671262c

Please sign in to comment.