Skip to content

Commit 0aaf4d3

Browse files
committed
review comments
Created using spr 1.3.4
1 parent 7f6c044 commit 0aaf4d3

File tree

2 files changed

+300
-102
lines changed

2 files changed

+300
-102
lines changed

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,19 +1882,15 @@ bool IndVarSimplify::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
18821882
auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
18831883
if (HasThreadLocalSideEffects) {
18841884
const BasicBlock *Unreachable = nullptr;
1885-
const BasicBlock *InLoop = nullptr;
18861885
for (const BasicBlock *Succ : BI->successors()) {
18871886
if (isa<UnreachableInst>(Succ->getTerminator()))
18881887
Unreachable = Succ;
1889-
else if (L->contains(Succ))
1890-
InLoop = Succ;
18911888
}
18921889
// Exit BB which have one branch back into the loop and another one to
18931890
// a trap can still be optimized, because local side effects cannot
18941891
// be observed in the exit case (the trap). We could be smarter about
18951892
// this, but for now lets pattern match common cases that directly trap.
1896-
if (Unreachable == nullptr || InLoop == nullptr ||
1897-
!crashingBBWithoutEffect(*Unreachable))
1893+
if (Unreachable == nullptr || !crashingBBWithoutEffect(*Unreachable))
18981894
return Changed;
18991895
}
19001896
Value *NewCond;

0 commit comments

Comments
 (0)