1 ; RUN: llc -march=hexagon < %s | FileCheck %s
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"
6 ; Generate the inline restore for single register pair for functions
7 ; with "optsize" attribute.
10 ; CHECK-DAG: memd{{.*}} = r17:16
11 ; CHECK-DAG: r17:16 = memd{{.*}}
12 ; CHECK-DAG: deallocframe
13 ; CHECK-NOT: call __restore
15 define i32 @fred_os(i32 %x) #0 {
17 %call = tail call i32 @foo(i32 %x) #2
18 %call1 = tail call i32 @bar(i32 %x, i32 %call) #2
22 ; Generate the restoring call for single register pair for functions
23 ; with "minsize" attribute.
25 ; CHECK-LABEL: fred_oz
26 ; CHECK-DAG: memd{{.*}} = r17:16
27 ; CHECK-NOT: r17:16 = memd{{.*}}
28 ; CHECK-DAG: call __restore
30 define i32 @fred_oz(i32 %x) #1 {
32 %call = tail call i32 @foo(i32 %x) #2
33 %call1 = tail call i32 @bar(i32 %x, i32 %call) #2
37 declare i32 @foo(i32) #2
38 declare i32 @bar(i32, i32) #2
40 attributes #0 = { nounwind optsize "disable-tail-calls"="false" }
41 attributes #1 = { nounwind minsize "disable-tail-calls"="false" }
42 attributes #2 = { nounwind optsize }