Chen Li | 50efd92 | 2015-08-05 21:13:26 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -loop-unswitch -S < %s 2>&1 | FileCheck %s |
Alina Sbirlea | a496143 | 2018-09-11 19:19:21 +0000 | [diff] [blame] | 2 | ; RUN: opt < %s -loop-unswitch -enable-mssa-loop-dependency=true -verify-memoryssa -S < %s 2>&1 | FileCheck %s |
Chen Li | 50efd92 | 2015-08-05 21:13:26 +0000 | [diff] [blame] | 3 | |
| 4 | ; This test checks if unswitched condition preserve make.implicit metadata. |
| 5 | |
| 6 | define i32 @test(i1 %cond) { |
Sanjoy Das | 92ce1e7 | 2017-04-11 04:11:47 +0000 | [diff] [blame] | 7 | ; CHECK-LABEL: @test( |
| 8 | ; CHECK: br i1 %cond, label %..split_crit_edge, label %.loop_exit.split_crit_edge, !make.implicit !0 |
Chen Li | 50efd92 | 2015-08-05 21:13:26 +0000 | [diff] [blame] | 9 | br label %loop_begin |
| 10 | |
| 11 | loop_begin: |
Chen Li | 50efd92 | 2015-08-05 21:13:26 +0000 | [diff] [blame] | 12 | br i1 %cond, label %continue, label %loop_exit, !make.implicit !0 |
| 13 | |
| 14 | continue: |
| 15 | call void @some_func() |
| 16 | br label %loop_begin |
| 17 | |
| 18 | loop_exit: |
| 19 | ret i32 0 |
| 20 | } |
| 21 | |
| 22 | declare void @some_func() |
| 23 | |
| 24 | !0 = !{} |