Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -loop-rotate -S | FileCheck %s |
| 2 | ; RUN: opt < %s -loop-rotate -enable-mssa-loop-dependency=true -verify-memoryssa -S | FileCheck %s |
| 3 | |
| 4 | target triple = "x86_64-pc-windows-msvc" |
| 5 | |
| 6 | declare void @always_throws() |
| 7 | |
| 8 | define i32 @test() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { |
| 9 | entry: |
| 10 | invoke void @always_throws() |
| 11 | to label %continue unwind label %catch.dispatch |
| 12 | |
| 13 | continue: |
| 14 | unreachable |
| 15 | |
| 16 | catch.dispatch: |
| 17 | %t0 = catchswitch within none [label %catch] unwind to caller |
| 18 | |
| 19 | catch: |
| 20 | %t1 = catchpad within %t0 [i8* null, i32 64, i8* null] |
| 21 | catchret from %t1 to label %for.cond |
| 22 | |
| 23 | for.cond: |
| 24 | %sum = phi i32 [ %add, %for.body ], [ 0, %catch ] |
| 25 | %i = phi i32 [ %inc, %for.body ], [ 0, %catch ] |
| 26 | %cmp = icmp slt i32 %i, 1 |
| 27 | br i1 %cmp, label %for.body, label %return |
| 28 | |
| 29 | for.body: |
| 30 | %add = add nsw i32 1, %sum |
| 31 | %inc = add nsw i32 %i, 1 |
| 32 | br label %for.cond |
| 33 | |
| 34 | return: |
| 35 | ret i32 0 |
| 36 | } |
| 37 | |
| 38 | ; CHECK: catch: |
| 39 | ; CHECK-NEXT: catchpad |
| 40 | ; CHECK-NEXT: catchret |
| 41 | |
| 42 | declare i32 @__CxxFrameHandler3(...) |