xref: /llvm-project/llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll (revision e6e857cdf9826032dcb12e660d9d84b9f1865ae3)
1; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' %s -o - 2>&1 | FileCheck %s -check-prefixes=CHECK
2; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=pic %s -o - 2>&1 | FileCheck %s -check-prefixes=PIC
3; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=ropi %s -o - 2>&1 | FileCheck %s -check-prefixes=ROPI
4; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=rwpi %s -o - 2>&1 | FileCheck %s -check-prefixes=RWPI
5; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=ropi-rwpi %s -o - 2>&1 | FileCheck %s -check-prefixes=ROPI-RWPI
6
7; This file checks that we use the fallback path for things that are known to
8; be unsupported on the ARM target. It should progressively shrink in size.
9
10define <4 x i32> @test_int_vectors(<4 x i32> %a, <4 x i32> %b) {
11; CHECK: remark: {{.*}} unable to lower arguments: <4 x i32> (<4 x i32>, <4 x i32>)
12; CHECK-LABEL: warning: Instruction selection used fallback path for test_int_vectors
13  %res = add <4 x i32> %a, %b
14  ret <4 x i32> %res
15}
16
17define <4 x float> @test_float_vectors(<4 x float> %a, <4 x float> %b) {
18; CHECK: remark: {{.*}} unable to lower arguments: <4 x float> (<4 x float>, <4 x float>)
19; CHECK-LABEL: warning: Instruction selection used fallback path for test_float_vectors
20  %res = fadd <4 x float> %a, %b
21  ret <4 x float> %res
22}
23
24define i64 @test_i64(i64 %a, i64 %b) {
25; CHECK: remark: {{.*}} unable to lower arguments: i64 (i64, i64)
26; CHECK-LABEL: warning: Instruction selection used fallback path for test_i64
27  %res = add i64 %a, %b
28  ret i64 %res
29}
30
31define void @test_i64_arr([1 x i64] %a) {
32; CHECK: remark: {{.*}} unable to lower arguments: void ([1 x i64])
33; CHECK-LABEL: warning: Instruction selection used fallback path for test_i64_arr
34  ret void
35}
36
37define i128 @test_i128(i128 %a, i128 %b) {
38; CHECK: remark: {{.*}} unable to lower arguments: i128 (i128, i128)
39; CHECK-LABEL: warning: Instruction selection used fallback path for test_i128
40  %res = add i128 %a, %b
41  ret i128 %res
42}
43
44define i17 @test_funny_ints(i17 %a, i17 %b) {
45; CHECK: remark: {{.*}} unable to lower arguments: i17 (i17, i17)
46; CHECK-LABEL: warning: Instruction selection used fallback path for test_funny_ints
47  %res = add i17 %a, %b
48  ret i17 %res
49}
50
51define half @test_half(half %a, half %b) {
52; CHECK: remark: {{.*}} unable to legalize instruction: %{{[0-9]+}}:_(s16) = G_FADD %{{[0-9]+}}:_, %{{[0-9]+}}:_ (in function: test_half)
53; CHECK-LABEL: warning: Instruction selection used fallback path for test_half
54  %res = fadd half %a, %b
55  ret half %res
56}
57
58declare [16 x i32] @ret_demotion_target()
59
60define [16 x i32] @test_ret_demotion() {
61; CHECK: remark: {{.*}} unable to translate instruction: call{{.*}} @ret_demotion_target
62; CHECK-LABEL: warning: Instruction selection used fallback path for test_ret_demotion
63  %res = call [16 x i32] @ret_demotion_target()
64  ret [16 x i32] %res
65}
66
67%large.struct = type { i32, i32, i32, i32, i32} ; Doesn't fit in R0-R3
68
69declare %large.struct @large_struct_return_target()
70
71define %large.struct @test_large_struct_return() {
72; CHECK: remark: {{.*}} unable to translate instruction: call{{.*}} @large_struct_return_target
73; CHECK-LABEL: warning: Instruction selection used fallback path for test_large_struct_return
74  %r = call %large.struct @large_struct_return_target()
75  ret %large.struct %r
76}
77
78%mixed.struct = type {ptr, float, i32}
79
80define %mixed.struct @test_mixed_struct(%mixed.struct %x) {
81; CHECK: remark: {{.*}} unable to lower arguments: %mixed.struct (%mixed.struct)
82; CHECK-LABEL: warning: Instruction selection used fallback path for test_mixed_struct
83  ret %mixed.struct %x
84}
85
86%bad.element.type = type {i24, i24}
87
88define void @test_bad_element_struct(%bad.element.type %x) {
89; CHECK: remark: {{.*}} unable to lower arguments: void (%bad.element.type)
90; CHECK-LABEL: warning: Instruction selection used fallback path for test_bad_element_struct
91  ret void
92}
93
94define void @test_vararg_definition(i32 %a, ...) {
95; CHECK: remark: {{.*}} unable to lower arguments: void (i32, ...)
96; CHECK-LABEL: warning: Instruction selection used fallback path for test_vararg_definition
97  ret void
98}
99
100define i32 @test_thumb(i32 %a) #0 {
101; CHECK: remark: {{.*}} unable to lower arguments: i32 (i32)
102; CHECK-LABEL: warning: Instruction selection used fallback path for test_thumb
103  ret i32 %a
104}
105
106@thread_local_global = thread_local global i32 42
107
108define i32 @test_thread_local_global() {
109; CHECK: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
110; CHECK-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
111; PIC: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
112; PIC-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
113; ROPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
114; ROPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
115; RWPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
116; RWPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
117; ROPI-RWPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
118; ROPI-RWPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
119  %v = load i32, ptr @thread_local_global
120  ret i32 %v
121}
122
123%byval.class = type { i32 }
124
125define void @test_byval_arg(ptr byval(%byval.class) %x) {
126; CHECK: remark: {{.*}} unable to lower arguments: void (ptr)
127; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval
128  ret void
129}
130
131define void @test_byval_param(ptr %x) {
132; CHECK: remark: {{.*}} unable to translate instruction: call
133; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval_param
134  call void @test_byval_arg(ptr byval(%byval.class) %x)
135  ret void
136}
137
138attributes #0 = { "target-features"="+thumb-mode" }
139