1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/FixIrreducible/unreachable.ll
Michael Liao 45cca1d233 [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
2020-07-11 10:08:44 -04:00

25 lines
393 B
LLVM

; 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
}