Chandler Carruth | 1353f9a | 2017-04-27 18:45:20 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -simple-loop-unswitch -S | FileCheck %s |
| 2 | |
| 3 | ; This test checks if unswitched condition preserve make.implicit metadata. |
| 4 | define i32 @test(i1 %cond) { |
| 5 | ; CHECK-LABEL: @test( |
| 6 | entry: |
| 7 | br label %loop_begin |
| 8 | ; CHECK-NEXT: entry: |
| 9 | ; CHECK-NEXT: br i1 %{{.*}}, label %entry.split, label %loop_exit, !make.implicit !0 |
| 10 | ; |
| 11 | ; CHECK: entry.split: |
| 12 | ; CHECK-NEXT: br label %loop_begin |
| 13 | |
| 14 | loop_begin: |
| 15 | br i1 %cond, label %continue, label %loop_exit, !make.implicit !0 |
| 16 | ; CHECK: loop_begin: |
| 17 | ; CHECK-NEXT: br label %continue |
| 18 | |
| 19 | continue: |
| 20 | call void @some_func() |
| 21 | br label %loop_begin |
| 22 | ; CHECK: continue: |
| 23 | ; CHECK-NEXT: call |
| 24 | ; CHECK-NEXT: br label %loop_begin |
| 25 | |
| 26 | loop_exit: |
| 27 | ret i32 0 |
| 28 | ; CHECK: loop_exit: |
| 29 | ; CHECK-NEXT: ret |
| 30 | } |
| 31 | |
| 32 | declare void @some_func() |
| 33 | |
| 34 | !0 = !{} |