summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-05-23 23:51:54 +0000
committerDavide Italiano <davide@freebsd.org>2017-05-23 23:51:54 +0000
commit7bf95b964fb7c0e3e8ae0f71c79ab3e71300e49b (patch)
tree13750317741948c97a9635ace76c2e674a982ae7 /llvm/lib
parentaeb4b7d217dae0ad2d29a5aa9a67cf2309432522 (diff)
downloadbcm5719-llvm-7bf95b964fb7c0e3e8ae0f71c79ab3e71300e49b.tar.gz
bcm5719-llvm-7bf95b964fb7c0e3e8ae0f71c79ab3e71300e49b.zip
[LIR] Use the newly `getRecurrenceVar()` helper. NFCI.
llvm-svn: 303704
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 8f0bf8672a5..c6a05ecbd0b 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1139,8 +1139,8 @@ static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB,
if (!Inc || !Inc->isOne())
continue;
- PHINode *Phi = dyn_cast<PHINode>(Inst->getOperand(0));
- if (!Phi || Phi->getParent() != LoopEntry)
+ PHINode *Phi = getRecurrenceVar(Inst->getOperand(0), Inst, LoopEntry);
+ if (!Phi)
continue;
// Check if the result of the instruction is live of the loop.
@@ -1255,8 +1255,8 @@ static bool detectCTLZIdiom(Loop *CurLoop, PHINode *&PhiX,
if (!Inc || !Inc->isOne())
continue;
- PHINode *Phi = dyn_cast<PHINode>(Inst->getOperand(0));
- if (!Phi || Phi->getParent() != LoopEntry)
+ PHINode *Phi = getRecurrenceVar(Inst->getOperand(0), Inst, LoopEntry);
+ if (!Phi)
continue;
CntInst = Inst;
OpenPOWER on IntegriCloud