Krzysztof Parzyszek | bb63f66 | 2016-03-28 14:52:21 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s | FileCheck %s |
| 2 | |
| 3 | target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048" |
| 4 | target triple = "hexagon" |
| 5 | |
| 6 | ; Generate the inline restore for single register pair for functions |
| 7 | ; with "optsize" attribute. |
| 8 | |
| 9 | ; CHECK-LABEL: fred_os |
| 10 | ; CHECK-DAG: memd{{.*}} = r17:16 |
| 11 | ; CHECK-DAG: r17:16 = memd{{.*}} |
| 12 | ; CHECK-DAG: deallocframe |
| 13 | ; CHECK-NOT: call __restore |
| 14 | |
| 15 | define i32 @fred_os(i32 %x) #0 { |
| 16 | entry: |
| 17 | %call = tail call i32 @foo(i32 %x) #2 |
| 18 | %call1 = tail call i32 @bar(i32 %x, i32 %call) #2 |
| 19 | ret i32 %call1 |
| 20 | } |
| 21 | |
| 22 | ; Generate the restoring call for single register pair for functions |
| 23 | ; with "minsize" attribute. |
| 24 | |
| 25 | ; CHECK-LABEL: fred_oz |
| 26 | ; CHECK-DAG: memd{{.*}} = r17:16 |
| 27 | ; CHECK-NOT: r17:16 = memd{{.*}} |
| 28 | ; CHECK-DAG: call __restore |
| 29 | |
| 30 | define i32 @fred_oz(i32 %x) #1 { |
| 31 | entry: |
| 32 | %call = tail call i32 @foo(i32 %x) #2 |
| 33 | %call1 = tail call i32 @bar(i32 %x, i32 %call) #2 |
| 34 | ret i32 %call1 |
| 35 | } |
| 36 | |
| 37 | declare i32 @foo(i32) #2 |
| 38 | declare i32 @bar(i32, i32) #2 |
| 39 | |
| 40 | attributes #0 = { nounwind optsize "disable-tail-calls"="false" } |
| 41 | attributes #1 = { nounwind minsize "disable-tail-calls"="false" } |
| 42 | attributes #2 = { nounwind optsize } |