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
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.
10 define <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
17 define <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
24 define 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
31 define 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
37 define 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
44 define 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
51 define half @test_half(half %a, half %b) {
52 ; CHECK: remark: {{.*}} unable to translate instruction: ret: ' ret half %res' (in function: test_half)
53 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_half
54 %res = fadd half %a, %b
58 declare [16 x i32] @ret_demotion_target()
60 define [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()
67 %large.struct = type { i32, i32, i32, i32, i32} ; Doesn't fit in R0-R3
69 declare %large.struct @large_struct_return_target()
71 define %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()
78 %mixed.struct = type {i32*, float, i32}
80 define %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
86 %bad.element.type = type {i24, i24}
88 define 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
94 define 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
100 define 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
106 @thread_local_global = thread_local global i32 42
108 define 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, i32* @thread_local_global
123 %byval.class = type { i32 }
125 define void @test_byval_arg(%byval.class* byval %x) {
126 ; CHECK: remark: {{.*}} unable to lower arguments: void (%byval.class*)*
127 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval
131 define void @test_byval_param(%byval.class* %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(%byval.class* byval %x)
138 attributes #0 = { "target-features"="+thumb-mode" }