llvm-project
32 строки · 894.0 Байт
1; RUN: opt < %s -passes=simple-loop-unswitch,indvars -disable-output
2; Require SCEV before LCSSA.
3define void @foo() {
4entry:
5%i = alloca i32, align 4 ; <ptr> [#uses=5]
6%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
7store i32 0, ptr %i, align 4
8br label %bb3
9
10bb: ; preds = %bb3
11%tmp = load i32, ptr %i, align 4 ; <i32> [#uses=1]
12call void @bar( i32 %tmp )
13%tmp1 = load i32, ptr %i, align 4 ; <i32> [#uses=1]
14%tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
15store i32 %tmp2, ptr %i, align 4
16br label %bb3
17
18bb3: ; preds = %bb, %entry
19%tmp4 = load i32, ptr %i, align 4 ; <i32> [#uses=1]
20%tmp5 = icmp sle i32 %tmp4, 9 ; <i1> [#uses=1]
21%tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
22%toBool = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1]
23br i1 %toBool, label %bb, label %bb7
24
25bb7: ; preds = %bb3
26br label %return
27
28return: ; preds = %bb7
29ret void
30}
31
32declare void @bar(i32)
33