-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix-irreducible] Skip unreachable predecessors.
Summary: - Skip unreachable predecessors during header detection in SCC. Those unreachable blocks would be generated in the switch lowering pass in the corner cases or other frontends. Even though they could be removed through the CFG simplification, we should skip them during header detection. Reviewers: sameerds Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83562
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; RUN: opt %s -fix-irreducible -S -o - | FileCheck %s | ||
|
||
; CHECK-LABEL: @unreachable( | ||
; CHECK: entry: | ||
; CHECK-NOT: irr.guard: | ||
define void @unreachable(i32 %n) { | ||
entry: | ||
br label %loop.body | ||
|
||
loop.body: | ||
br label %inner.block | ||
|
||
unreachable.block: | ||
br label %inner.block | ||
|
||
inner.block: | ||
br i1 undef, label %loop.exit, label %loop.latch | ||
|
||
loop.latch: | ||
br label %loop.body | ||
|
||
loop.exit: | ||
ret void | ||
} |