• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -loop-deletion -S | FileCheck %s
2
3; Checking that possible users of instruction from the loop in
4; unreachable blocks are handled.
5
6define i64 @foo() {
7entry:
8  br label %invloop
9; CHECK-LABEL-NOT: invloop
10invloop:
11  %indvar1 = phi i64 [ 3, %entry ], [ %indvar2, %invloop_iter ]
12  %check = icmp ult i64 %indvar1, 400
13  br i1 %check, label %invloop_iter, label %loopexit
14invloop_iter:
15  %indvar2 = add i64 %indvar1, 1
16  %baddef = add i64 0, 0
17  br label %invloop
18loopexit:
19  ret i64 0
20deadcode:
21; CHECK-LABEL: deadcode
22; CHECK: ret i64 undef
23  ret i64 %baddef
24}
25