summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJatin Bhateja <jatin.bhateja@gmail.com>2017-11-26 02:01:01 +0000
committerJatin Bhateja <jatin.bhateja@gmail.com>2017-11-26 02:01:01 +0000
commita1da5e4ce743352b916c4d0378cb945b76c1d22d (patch)
treecee2b7371fcceddea22cabbe48977b880e4309c4 /llvm/lib
parentc4eb50563b57c84edbe091d54999db3725f57903 (diff)
downloadbcm5719-llvm-a1da5e4ce743352b916c4d0378cb945b76c1d22d.tar.gz
bcm5719-llvm-a1da5e4ce743352b916c4d0378cb945b76c1d22d.zip
[SCEV] NFC : Removing unnecessary check on outgoing branches of a branch instr.
Summary: For a given loop, getLoopLatch returns a non-null value when a loop has only one latch block. In the modified context a check on both the outgoing branches of a terminator instruction (of latch) to same header is redundant. Reviewers: jbhateja Reviewed By: jbhateja Subscribers: sanjoy Differential Revision: https://reviews.llvm.org/D40460 llvm-svn: 318991
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index d2a7a545733..53e216a5dc5 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -4092,8 +4092,7 @@ public:
Value *BECond = nullptr;
if (BasicBlock *Latch = L->getLoopLatch()) {
BranchInst *BI = dyn_cast<BranchInst>(Latch->getTerminator());
- if (BI && BI->isConditional() &&
- BI->getSuccessor(0) != BI->getSuccessor(1)) {
+ if (BI && BI->isConditional()) {
BECond = BI->getCondition();
IsPosBECond = BI->getSuccessor(0) == L->getHeader();
} else {
OpenPOWER on IntegriCloud