Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame^] | 1 | ; RUN: opt -passes="function(slp-vectorizer),module(hotcoldsplit),function(slp-vectorizer,print<assumptions>)" -disable-output %s 2>&1 | FileCheck %s |
| 2 | ; |
| 3 | ; Make sure this compiles. Check that function assumption cache is refreshed |
| 4 | ; after extracting blocks with assume calls from the function. |
| 5 | |
| 6 | ; CHECK: Cached assumptions for function: fun |
| 7 | ; CHECK-NEXT: Cached assumptions for function: fun.cold |
| 8 | ; CHECK-NEXT: %cmp = icmp uge i32 %x, 64 |
| 9 | |
| 10 | declare void @fun2(i32) #0 |
| 11 | |
| 12 | define void @fun(i32 %x) { |
| 13 | entry: |
| 14 | br i1 undef, label %if.then, label %if.else |
| 15 | |
| 16 | if.then: |
| 17 | ret void |
| 18 | |
| 19 | if.else: |
| 20 | %cmp = icmp uge i32 %x, 64 |
| 21 | call void @llvm.assume(i1 %cmp) |
| 22 | call void @fun2(i32 %x) |
| 23 | unreachable |
| 24 | } |
| 25 | |
| 26 | declare void @llvm.assume(i1) #1 |
| 27 | |
| 28 | attributes #0 = { alwaysinline } |
| 29 | attributes #1 = { nounwind } |