comparison polly/test/CodeGen/loop_with_condition_2.ll @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
24 %tmp1 = zext i32 %tmp to i64 24 %tmp1 = zext i32 %tmp to i64
25 br label %for.cond 25 br label %for.cond
26 26
27 for.cond: ; preds = %for.inc, %entry 27 for.cond: ; preds = %for.inc, %entry
28 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ] 28 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
29 %arrayidx = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar 29 %arrayidx = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar
30 %arrayidx10 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar 30 %arrayidx10 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar
31 %tmp2 = add i64 %tmp1, %indvar 31 %tmp2 = add i64 %tmp1, %indvar
32 %sub = trunc i64 %tmp2 to i32 32 %sub = trunc i64 %tmp2 to i32
33 %exitcond = icmp ne i64 %indvar, 1024 33 %exitcond = icmp ne i64 %indvar, 1024
34 br i1 %exitcond, label %for.body, label %for.end 34 br i1 %exitcond, label %for.body, label %for.end
35 35
36 for.body: ; preds = %for.cond 36 for.body: ; preds = %for.cond
37 %cmp3 = icmp sle i32 %sub, 1024 37 %cmp3 = icmp sle i32 %sub, 1024
38 br i1 %cmp3, label %if.then, label %if.else 38 br i1 %cmp3, label %if.then, label %if.else
39 39
40 if.then: ; preds = %for.body 40 if.then: ; preds = %for.body
41 store i32 1, i32* %arrayidx 41 store i32 1, ptr %arrayidx
42 br label %if.end 42 br label %if.end
43 43
44 if.else: ; preds = %for.body 44 if.else: ; preds = %for.body
45 store i32 2, i32* %arrayidx 45 store i32 2, ptr %arrayidx
46 br label %if.end 46 br label %if.end
47 47
48 if.end: ; preds = %if.else, %if.then 48 if.end: ; preds = %if.else, %if.then
49 store i32 3, i32* %arrayidx10 49 store i32 3, ptr %arrayidx10
50 br label %for.inc 50 br label %for.inc
51 51
52 for.inc: ; preds = %if.end 52 for.inc: ; preds = %if.end
53 %indvar.next = add i64 %indvar, 1 53 %indvar.next = add i64 %indvar, 1
54 br label %for.cond 54 br label %for.cond
58 ret void 58 ret void
59 } 59 }
60 60
61 define i32 @main() nounwind { 61 define i32 @main() nounwind {
62 entry: 62 entry:
63 call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @A to i8*), i8 0, i64 4096, i32 1, i1 false) 63 call void @llvm.memset.p0.i64(ptr @A, i8 0, i64 4096, i32 1, i1 false)
64 call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @B to i8*), i8 0, i64 4096, i32 1, i1 false) 64 call void @llvm.memset.p0.i64(ptr @B, i8 0, i64 4096, i32 1, i1 false)
65 call void @loop_with_condition(i32 5) 65 call void @loop_with_condition(i32 5)
66 br label %for.cond 66 br label %for.cond
67 67
68 for.cond: ; preds = %for.inc, %entry 68 for.cond: ; preds = %for.inc, %entry
69 %indvar1 = phi i64 [ %indvar.next2, %for.inc ], [ 0, %entry ] 69 %indvar1 = phi i64 [ %indvar.next2, %for.inc ], [ 0, %entry ]
70 %arrayidx = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar1 70 %arrayidx = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar1
71 %i.0 = trunc i64 %indvar1 to i32 71 %i.0 = trunc i64 %indvar1 to i32
72 %cmp = icmp slt i32 %i.0, 1024 72 %cmp = icmp slt i32 %i.0, 1024
73 br i1 %cmp, label %for.body, label %for.end 73 br i1 %cmp, label %for.body, label %for.end
74 74
75 for.body: ; preds = %for.cond 75 for.body: ; preds = %for.cond
76 %tmp3 = load i32, i32* %arrayidx 76 %tmp3 = load i32, ptr %arrayidx
77 %cmp4 = icmp ne i32 %tmp3, 3 77 %cmp4 = icmp ne i32 %tmp3, 3
78 br i1 %cmp4, label %if.then, label %if.end 78 br i1 %cmp4, label %if.then, label %if.end
79 79
80 if.then: ; preds = %for.body 80 if.then: ; preds = %for.body
81 br label %return 81 br label %return
90 for.end: ; preds = %for.cond 90 for.end: ; preds = %for.cond
91 br label %for.cond6 91 br label %for.cond6
92 92
93 for.cond6: ; preds = %for.inc12, %for.end 93 for.cond6: ; preds = %for.inc12, %for.end
94 %indvar = phi i64 [ %indvar.next, %for.inc12 ], [ 0, %for.end ] 94 %indvar = phi i64 [ %indvar.next, %for.inc12 ], [ 0, %for.end ]
95 %arrayidx15 = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar 95 %arrayidx15 = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar
96 %i.1 = trunc i64 %indvar to i32 96 %i.1 = trunc i64 %indvar to i32
97 %cmp8 = icmp slt i32 %i.1, 1024 97 %cmp8 = icmp slt i32 %i.1, 1024
98 br i1 %cmp8, label %for.body9, label %for.end35 98 br i1 %cmp8, label %for.body9, label %for.end35
99 99
100 for.body9: ; preds = %for.cond6 100 for.body9: ; preds = %for.cond6
101 br i1 true, label %land.lhs.true, label %if.else 101 br i1 true, label %land.lhs.true, label %if.else
102 102
103 land.lhs.true: ; preds = %for.body9 103 land.lhs.true: ; preds = %for.body9
104 %tmp16 = load i32, i32* %arrayidx15 104 %tmp16 = load i32, ptr %arrayidx15
105 %cmp17 = icmp ne i32 %tmp16, 1 105 %cmp17 = icmp ne i32 %tmp16, 1
106 br i1 %cmp17, label %if.then18, label %if.else 106 br i1 %cmp17, label %if.then18, label %if.else
107 107
108 if.then18: ; preds = %land.lhs.true 108 if.then18: ; preds = %land.lhs.true
109 br label %return 109 br label %return
110 110
111 if.else: ; preds = %land.lhs.true, %for.body9 111 if.else: ; preds = %land.lhs.true, %for.body9
112 br i1 false, label %land.lhs.true23, label %if.end30 112 br i1 false, label %land.lhs.true23, label %if.end30
113 113
114 land.lhs.true23: ; preds = %if.else 114 land.lhs.true23: ; preds = %if.else
115 %tmp27 = load i32, i32* %arrayidx15 115 %tmp27 = load i32, ptr %arrayidx15
116 %cmp28 = icmp ne i32 %tmp27, 2 116 %cmp28 = icmp ne i32 %tmp27, 2
117 br i1 %cmp28, label %if.then29, label %if.end30 117 br i1 %cmp28, label %if.then29, label %if.end30
118 118
119 if.then29: ; preds = %land.lhs.true23 119 if.then29: ; preds = %land.lhs.true23
120 br label %return 120 br label %return
135 return: ; preds = %for.end35, %if.then29, %if.then18, %if.then 135 return: ; preds = %for.end35, %if.then29, %if.then18, %if.then
136 %retval.0 = phi i32 [ 1, %if.then ], [ 1, %if.then18 ], [ 1, %if.then29 ], [ 0, %for.end35 ] 136 %retval.0 = phi i32 [ 1, %if.then ], [ 1, %if.then18 ], [ 1, %if.then29 ], [ 0, %for.end35 ]
137 ret i32 %retval.0 137 ret i32 %retval.0
138 } 138 }
139 139
140 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind 140 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1) nounwind