OLD | NEW |
1 ; Test the the loop nest depth is correctly calculated for basic blocks. | 1 ; Test the the loop nest depth is correctly calculated for basic blocks. |
2 | 2 |
3 ; REQUIRES: allow_dump | 3 ; REQUIRES: allow_dump |
4 | 4 |
5 ; Single threaded so that the dumps used for checking happen in order | 5 ; Single threaded so that the dumps used for checking happen in order |
6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 --verbose=loop \ | 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 --verbose=loop \ |
7 ; RUN: --threads=0 | FileCheck %s | 7 ; RUN: --threads=0 | FileCheck %s |
8 | 8 |
9 define internal void @test_single_loop(i32 %a32) { | 9 define internal void @test_single_loop(i32 %a32) { |
10 entry: | 10 entry: |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ; CHECK-LABEL: After loop nest depth analysis | 272 ; CHECK-LABEL: After loop nest depth analysis |
273 ; CHECK-NEXT: entry: | 273 ; CHECK-NEXT: entry: |
274 ; CHECK-NEXT: LoopNestDepth = 0 | 274 ; CHECK-NEXT: LoopNestDepth = 0 |
275 ; CHECK-NEXT: left: | 275 ; CHECK-NEXT: left: |
276 ; CHECK-NEXT: LoopNestDepth = 0 | 276 ; CHECK-NEXT: LoopNestDepth = 0 |
277 ; CHECK-NEXT: right: | 277 ; CHECK-NEXT: right: |
278 ; CHECK-NEXT: LoopNestDepth = 0 | 278 ; CHECK-NEXT: LoopNestDepth = 0 |
279 ; CHECK-NEXT: out: | 279 ; CHECK-NEXT: out: |
280 ; CHECK-NEXT: LoopNestDepth = 0 | 280 ; CHECK-NEXT: LoopNestDepth = 0 |
281 ; CHECK-LABEL: Before RMW | 281 ; CHECK-LABEL: Before RMW |
| 282 |
| 283 define internal void @test_single_block_loop(i32 %count) { |
| 284 entry: |
| 285 br label %body |
| 286 body: |
| 287 ; %i = phi i32 [ 0, %entry ], [ %inc, %body ] |
| 288 ; A normal loop would have a phi instruction like above for the induction |
| 289 ; variable, but that may introduce new basic blocks due to phi edge splitting, |
| 290 ; so we use an alternative definition for %i to make the test more clear. |
| 291 %i = add i32 %count, 1 |
| 292 %inc = add i32 %i, 1 |
| 293 %cmp = icmp slt i32 %inc, %count |
| 294 br i1 %cmp, label %body, label %exit |
| 295 exit: |
| 296 ret void |
| 297 } |
| 298 |
| 299 ; CHECK-LABEL: After loop nest depth analysis |
| 300 ; CHECK-NEXT: entry: |
| 301 ; CHECK-NEXT: LoopNestDepth = 0 |
| 302 ; CHECK-NEXT: body: |
| 303 ; CHECK-NEXT: LoopNestDepth = 1 |
| 304 ; CHECK-NEXT: exit: |
| 305 ; CHECK-NEXT: LoopNestDepth = 0 |
| 306 ; CHECK-LABEL: Before RMW |
OLD | NEW |