|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --version 6 |
| 2 | +; RUN: opt -passes=loop-vectorize -force-vector-width=2 -force-vector-interleave=1 -prefer-predicate-over-epilogue=predicate-dont-vectorize -S %s | FileCheck --check-prefix=VF2IC1 %s |
| 3 | +; RUN: opt -passes=loop-vectorize -force-vector-width=2 -force-vector-interleave=2 -prefer-predicate-over-epilogue=predicate-dont-vectorize -S %s | FileCheck --check-prefix=VF2IC2 %s |
| 4 | +; RUN: opt -passes=loop-vectorize -force-vector-width=1 -force-vector-interleave=2 -prefer-predicate-over-epilogue=predicate-dont-vectorize -S %s | FileCheck --check-prefix=VF1IC2 %s |
| 5 | + |
| 6 | +define i32 @FOR_used_outside(ptr noalias %A, ptr noalias %B, i64 %n) { |
| 7 | +; VF2IC1-LABEL: define i32 @FOR_used_outside( |
| 8 | +; VF2IC1-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 9 | +; VF2IC1-NEXT: [[ENTRY:.*]]: |
| 10 | +; VF2IC1-NEXT: br label %[[LOOP:.*]] |
| 11 | +; VF2IC1: [[LOOP]]: |
| 12 | +; VF2IC1-NEXT: [[TMP1:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 13 | +; VF2IC1-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP10:%.*]], %[[LOOP]] ] |
| 14 | +; VF2IC1-NEXT: [[TMP9:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP1]] |
| 15 | +; VF2IC1-NEXT: [[TMP10]] = load i32, ptr [[TMP9]], align 4 |
| 16 | +; VF2IC1-NEXT: [[TMP23:%.*]] = add nsw i32 [[FOR]], [[TMP10]] |
| 17 | +; VF2IC1-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP1]] |
| 18 | +; VF2IC1-NEXT: store i32 [[TMP23]], ptr [[TMP20]], align 4 |
| 19 | +; VF2IC1-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP1]], 1 |
| 20 | +; VF2IC1-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 21 | +; VF2IC1-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 22 | +; VF2IC1: [[FOR_END]]: |
| 23 | +; VF2IC1-NEXT: [[TMP32:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 24 | +; VF2IC1-NEXT: ret i32 [[TMP32]] |
| 25 | +; |
| 26 | +; VF2IC2-LABEL: define i32 @FOR_used_outside( |
| 27 | +; VF2IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 28 | +; VF2IC2-NEXT: [[ENTRY:.*]]: |
| 29 | +; VF2IC2-NEXT: br label %[[LOOP:.*]] |
| 30 | +; VF2IC2: [[LOOP]]: |
| 31 | +; VF2IC2-NEXT: [[TMP3:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 32 | +; VF2IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP23:%.*]], %[[LOOP]] ] |
| 33 | +; VF2IC2-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP3]] |
| 34 | +; VF2IC2-NEXT: [[TMP23]] = load i32, ptr [[TMP22]], align 4 |
| 35 | +; VF2IC2-NEXT: [[TMP47:%.*]] = add nsw i32 [[FOR]], [[TMP23]] |
| 36 | +; VF2IC2-NEXT: [[TMP44:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP3]] |
| 37 | +; VF2IC2-NEXT: store i32 [[TMP47]], ptr [[TMP44]], align 4 |
| 38 | +; VF2IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP3]], 1 |
| 39 | +; VF2IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 40 | +; VF2IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 41 | +; VF2IC2: [[FOR_END]]: |
| 42 | +; VF2IC2-NEXT: [[TMP66:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 43 | +; VF2IC2-NEXT: ret i32 [[TMP66]] |
| 44 | +; |
| 45 | +; VF1IC2-LABEL: define i32 @FOR_used_outside( |
| 46 | +; VF1IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 47 | +; VF1IC2-NEXT: [[ENTRY:.*]]: |
| 48 | +; VF1IC2-NEXT: br label %[[LOOP:.*]] |
| 49 | +; VF1IC2: [[LOOP]]: |
| 50 | +; VF1IC2-NEXT: [[TMP0:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 51 | +; VF1IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP7:%.*]], %[[LOOP]] ] |
| 52 | +; VF1IC2-NEXT: [[TMP6:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP0]] |
| 53 | +; VF1IC2-NEXT: [[TMP7]] = load i32, ptr [[TMP6]], align 4 |
| 54 | +; VF1IC2-NEXT: [[TMP12:%.*]] = add nsw i32 [[FOR]], [[TMP7]] |
| 55 | +; VF1IC2-NEXT: [[TMP11:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP0]] |
| 56 | +; VF1IC2-NEXT: store i32 [[TMP12]], ptr [[TMP11]], align 4 |
| 57 | +; VF1IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP0]], 1 |
| 58 | +; VF1IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 59 | +; VF1IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 60 | +; VF1IC2: [[FOR_END]]: |
| 61 | +; VF1IC2-NEXT: [[TMP30:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 62 | +; VF1IC2-NEXT: ret i32 [[TMP30]] |
| 63 | +; |
| 64 | +entry: |
| 65 | + br label %loop |
| 66 | + |
| 67 | +loop: |
| 68 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] |
| 69 | + %for = phi i32 [ 33, %entry ], [ %for.next, %loop ] |
| 70 | + %gep.A = getelementptr inbounds nuw i32, ptr %A, i64 %iv |
| 71 | + %for.next = load i32, ptr %gep.A, align 4 |
| 72 | + %add = add nsw i32 %for, %for.next |
| 73 | + %gep.B = getelementptr inbounds nuw i32, ptr %B, i64 %iv |
| 74 | + store i32 %add, ptr %gep.B, align 4 |
| 75 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 76 | + %ec = icmp eq i64 %iv.next, %n |
| 77 | + br i1 %ec, label %for.end, label %loop |
| 78 | + |
| 79 | +for.end: |
| 80 | + ret i32 %for |
| 81 | +} |
| 82 | + |
| 83 | +define i32 @FOR_next_used_outside(ptr noalias %A, ptr noalias %B, i64 %n) { |
| 84 | +; VF2IC1-LABEL: define i32 @FOR_next_used_outside( |
| 85 | +; VF2IC1-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 86 | +; VF2IC1-NEXT: [[ENTRY:.*]]: |
| 87 | +; VF2IC1-NEXT: br label %[[LOOP:.*]] |
| 88 | +; VF2IC1: [[LOOP]]: |
| 89 | +; VF2IC1-NEXT: [[TMP1:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 90 | +; VF2IC1-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP10:%.*]], %[[LOOP]] ] |
| 91 | +; VF2IC1-NEXT: [[TMP9:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP1]] |
| 92 | +; VF2IC1-NEXT: [[TMP10]] = load i32, ptr [[TMP9]], align 4 |
| 93 | +; VF2IC1-NEXT: [[TMP23:%.*]] = add nsw i32 [[FOR]], [[TMP10]] |
| 94 | +; VF2IC1-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP1]] |
| 95 | +; VF2IC1-NEXT: store i32 [[TMP23]], ptr [[TMP20]], align 4 |
| 96 | +; VF2IC1-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP1]], 1 |
| 97 | +; VF2IC1-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 98 | +; VF2IC1-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 99 | +; VF2IC1: [[FOR_END]]: |
| 100 | +; VF2IC1-NEXT: [[TMP28:%.*]] = phi i32 [ [[TMP10]], %[[LOOP]] ] |
| 101 | +; VF2IC1-NEXT: ret i32 [[TMP28]] |
| 102 | +; |
| 103 | +; VF2IC2-LABEL: define i32 @FOR_next_used_outside( |
| 104 | +; VF2IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 105 | +; VF2IC2-NEXT: [[ENTRY:.*]]: |
| 106 | +; VF2IC2-NEXT: br label %[[LOOP:.*]] |
| 107 | +; VF2IC2: [[LOOP]]: |
| 108 | +; VF2IC2-NEXT: [[TMP3:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 109 | +; VF2IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP23:%.*]], %[[LOOP]] ] |
| 110 | +; VF2IC2-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP3]] |
| 111 | +; VF2IC2-NEXT: [[TMP23]] = load i32, ptr [[TMP22]], align 4 |
| 112 | +; VF2IC2-NEXT: [[TMP47:%.*]] = add nsw i32 [[FOR]], [[TMP23]] |
| 113 | +; VF2IC2-NEXT: [[TMP44:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP3]] |
| 114 | +; VF2IC2-NEXT: store i32 [[TMP47]], ptr [[TMP44]], align 4 |
| 115 | +; VF2IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP3]], 1 |
| 116 | +; VF2IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 117 | +; VF2IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 118 | +; VF2IC2: [[FOR_END]]: |
| 119 | +; VF2IC2-NEXT: [[TMP62:%.*]] = phi i32 [ [[TMP23]], %[[LOOP]] ] |
| 120 | +; VF2IC2-NEXT: ret i32 [[TMP62]] |
| 121 | +; |
| 122 | +; VF1IC2-LABEL: define i32 @FOR_next_used_outside( |
| 123 | +; VF1IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 124 | +; VF1IC2-NEXT: [[ENTRY:.*]]: |
| 125 | +; VF1IC2-NEXT: br label %[[LOOP:.*]] |
| 126 | +; VF1IC2: [[LOOP]]: |
| 127 | +; VF1IC2-NEXT: [[TMP0:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 128 | +; VF1IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP7:%.*]], %[[LOOP]] ] |
| 129 | +; VF1IC2-NEXT: [[TMP6:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP0]] |
| 130 | +; VF1IC2-NEXT: [[TMP7]] = load i32, ptr [[TMP6]], align 4 |
| 131 | +; VF1IC2-NEXT: [[TMP12:%.*]] = add nsw i32 [[FOR]], [[TMP7]] |
| 132 | +; VF1IC2-NEXT: [[TMP11:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP0]] |
| 133 | +; VF1IC2-NEXT: store i32 [[TMP12]], ptr [[TMP11]], align 4 |
| 134 | +; VF1IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP0]], 1 |
| 135 | +; VF1IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 136 | +; VF1IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 137 | +; VF1IC2: [[FOR_END]]: |
| 138 | +; VF1IC2-NEXT: [[TMP27:%.*]] = phi i32 [ [[TMP7]], %[[LOOP]] ] |
| 139 | +; VF1IC2-NEXT: ret i32 [[TMP27]] |
| 140 | +; |
| 141 | +entry: |
| 142 | + br label %loop |
| 143 | + |
| 144 | +loop: |
| 145 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] |
| 146 | + %for = phi i32 [ 33, %entry ], [ %for.next, %loop ] |
| 147 | + %gep.A = getelementptr inbounds nuw i32, ptr %A, i64 %iv |
| 148 | + %for.next = load i32, ptr %gep.A, align 4 |
| 149 | + %add = add nsw i32 %for, %for.next |
| 150 | + %gep.B = getelementptr inbounds nuw i32, ptr %B, i64 %iv |
| 151 | + store i32 %add, ptr %gep.B, align 4 |
| 152 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 153 | + %ec = icmp eq i64 %iv.next, %n |
| 154 | + br i1 %ec, label %for.end, label %loop |
| 155 | + |
| 156 | +for.end: |
| 157 | + ret i32 %for.next |
| 158 | +} |
| 159 | + |
| 160 | +define i32 @FOR_and_next_used_outside(ptr noalias %A, ptr noalias %B, i64 %n) { |
| 161 | +; VF2IC1-LABEL: define i32 @FOR_and_next_used_outside( |
| 162 | +; VF2IC1-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 163 | +; VF2IC1-NEXT: [[ENTRY:.*]]: |
| 164 | +; VF2IC1-NEXT: br label %[[LOOP:.*]] |
| 165 | +; VF2IC1: [[LOOP]]: |
| 166 | +; VF2IC1-NEXT: [[TMP1:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 167 | +; VF2IC1-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP10:%.*]], %[[LOOP]] ] |
| 168 | +; VF2IC1-NEXT: [[TMP9:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP1]] |
| 169 | +; VF2IC1-NEXT: [[TMP10]] = load i32, ptr [[TMP9]], align 4 |
| 170 | +; VF2IC1-NEXT: [[TMP23:%.*]] = add nsw i32 [[FOR]], [[TMP10]] |
| 171 | +; VF2IC1-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP1]] |
| 172 | +; VF2IC1-NEXT: store i32 [[TMP23]], ptr [[TMP20]], align 4 |
| 173 | +; VF2IC1-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP1]], 1 |
| 174 | +; VF2IC1-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 175 | +; VF2IC1-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 176 | +; VF2IC1: [[FOR_END]]: |
| 177 | +; VF2IC1-NEXT: [[TMP32:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 178 | +; VF2IC1-NEXT: [[TMP33:%.*]] = phi i32 [ [[TMP10]], %[[LOOP]] ] |
| 179 | +; VF2IC1-NEXT: [[RES:%.*]] = add i32 [[TMP32]], [[TMP33]] |
| 180 | +; VF2IC1-NEXT: ret i32 [[RES]] |
| 181 | +; |
| 182 | +; VF2IC2-LABEL: define i32 @FOR_and_next_used_outside( |
| 183 | +; VF2IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 184 | +; VF2IC2-NEXT: [[ENTRY:.*]]: |
| 185 | +; VF2IC2-NEXT: br label %[[LOOP:.*]] |
| 186 | +; VF2IC2: [[LOOP]]: |
| 187 | +; VF2IC2-NEXT: [[TMP3:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 188 | +; VF2IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP23:%.*]], %[[LOOP]] ] |
| 189 | +; VF2IC2-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP3]] |
| 190 | +; VF2IC2-NEXT: [[TMP23]] = load i32, ptr [[TMP22]], align 4 |
| 191 | +; VF2IC2-NEXT: [[TMP47:%.*]] = add nsw i32 [[FOR]], [[TMP23]] |
| 192 | +; VF2IC2-NEXT: [[TMP44:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP3]] |
| 193 | +; VF2IC2-NEXT: store i32 [[TMP47]], ptr [[TMP44]], align 4 |
| 194 | +; VF2IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP3]], 1 |
| 195 | +; VF2IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 196 | +; VF2IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 197 | +; VF2IC2: [[FOR_END]]: |
| 198 | +; VF2IC2-NEXT: [[TMP66:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 199 | +; VF2IC2-NEXT: [[TMP71:%.*]] = phi i32 [ [[TMP23]], %[[LOOP]] ] |
| 200 | +; VF2IC2-NEXT: [[RES:%.*]] = add i32 [[TMP66]], [[TMP71]] |
| 201 | +; VF2IC2-NEXT: ret i32 [[RES]] |
| 202 | +; |
| 203 | +; VF1IC2-LABEL: define i32 @FOR_and_next_used_outside( |
| 204 | +; VF1IC2-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], i64 [[N:%.*]]) { |
| 205 | +; VF1IC2-NEXT: [[ENTRY:.*]]: |
| 206 | +; VF1IC2-NEXT: br label %[[LOOP:.*]] |
| 207 | +; VF1IC2: [[LOOP]]: |
| 208 | +; VF1IC2-NEXT: [[TMP0:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] |
| 209 | +; VF1IC2-NEXT: [[FOR:%.*]] = phi i32 [ 33, %[[ENTRY]] ], [ [[TMP7:%.*]], %[[LOOP]] ] |
| 210 | +; VF1IC2-NEXT: [[TMP6:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[TMP0]] |
| 211 | +; VF1IC2-NEXT: [[TMP7]] = load i32, ptr [[TMP6]], align 4 |
| 212 | +; VF1IC2-NEXT: [[TMP12:%.*]] = add nsw i32 [[FOR]], [[TMP7]] |
| 213 | +; VF1IC2-NEXT: [[TMP11:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[TMP0]] |
| 214 | +; VF1IC2-NEXT: store i32 [[TMP12]], ptr [[TMP11]], align 4 |
| 215 | +; VF1IC2-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[TMP0]], 1 |
| 216 | +; VF1IC2-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]] |
| 217 | +; VF1IC2-NEXT: br i1 [[EC]], label %[[FOR_END:.*]], label %[[LOOP]] |
| 218 | +; VF1IC2: [[FOR_END]]: |
| 219 | +; VF1IC2-NEXT: [[TMP30:%.*]] = phi i32 [ [[FOR]], %[[LOOP]] ] |
| 220 | +; VF1IC2-NEXT: [[TMP33:%.*]] = phi i32 [ [[TMP7]], %[[LOOP]] ] |
| 221 | +; VF1IC2-NEXT: [[RES:%.*]] = add i32 [[TMP30]], [[TMP33]] |
| 222 | +; VF1IC2-NEXT: ret i32 [[RES]] |
| 223 | +; |
| 224 | +entry: |
| 225 | + br label %loop |
| 226 | + |
| 227 | +loop: |
| 228 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] |
| 229 | + %for = phi i32 [ 33, %entry ], [ %for.next, %loop ] |
| 230 | + %gep.A = getelementptr inbounds nuw i32, ptr %A, i64 %iv |
| 231 | + %for.next = load i32, ptr %gep.A, align 4 |
| 232 | + %add = add nsw i32 %for, %for.next |
| 233 | + %gep.B = getelementptr inbounds nuw i32, ptr %B, i64 %iv |
| 234 | + store i32 %add, ptr %gep.B, align 4 |
| 235 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 236 | + %ec = icmp eq i64 %iv.next, %n |
| 237 | + br i1 %ec, label %for.end, label %loop |
| 238 | + |
| 239 | +for.end: |
| 240 | + %res = add i32 %for, %for.next |
| 241 | + ret i32 %res |
| 242 | +} |
| 243 | + |
| 244 | + |
0 commit comments