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