• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -indvars -S < %s | FileCheck %s
2
3@b = common global i32 0, align 4
4
5define i32 @foo(i32 %x, i1 %y) {
6bb0:
7  br label %bb1
8
9bb1:
10  br i1 %y, label %bb14, label %bb8
11
12bb8:
13  %i = phi i64 [ %i.next, %bb8 ], [ 0, %bb1 ]
14  %i.next = add i64 %i, 1
15  %div = udiv i32 1, %x
16  %c = icmp eq i64 %i.next, 6
17  br i1 %c, label %bb11, label %bb8
18
19bb11:
20  br i1 %y, label %bb1, label %bb13
21
22bb13:
23  store i32 %div, i32* @b, align 4
24  br label %bb14
25
26bb14:
27  ret i32 0
28}
29
30; CHECK-LABEL: @foo(
31; CHECK: bb8:
32; CHECK: udiv
33