diff options
author | Jatin Bhateja <jatin.bhateja@gmail.com> | 2017-11-26 02:01:01 +0000 |
---|---|---|
committer | Jatin Bhateja <jatin.bhateja@gmail.com> | 2017-11-26 02:01:01 +0000 |
commit | 0d7d3a3c3255f9bafe37485d33262aa10ef8f29f (patch) | |
tree | e3fe4ac31e40261734810cc12047143ba8d9769e /lib/Analysis | |
parent | d4027e09f4a4e892ac862596da6d1ba14d4d4180 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index d2a7a545733..53e216a5dc5 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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 { |