1 ; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
3 ; Diagnose register constraints that are not wide enough.
5 ; ERR: error: couldn't allocate output register for constraint '{v[8:15]}'
6 define <9 x i32> @inline_asm_9xi32_in_8v_def() {
7 %asm = call <9 x i32> asm sideeffect "; def $0", "={v[8:15]}"()
11 ; ERR: error: couldn't allocate input reg for constraint '{v[8:15]}'
12 define void @inline_asm_9xi32_in_8v_use(<9 x i32> %val) {
13 call void asm sideeffect "; use $0", "{v[8:15]}"(<9 x i32> %val)
17 ; ERR: error: couldn't allocate output register for constraint '{s[8:15]}'
18 define <9 x i32> @inline_asm_9xi32_in_8s_def() {
19 %asm = call <9 x i32> asm sideeffect "; def $0", "={s[8:15]}"()
24 ; Diagnose register constraints that are too wide.
26 ; ERR: error: couldn't allocate output register for constraint '{v[8:16]}'
27 define <8 x i32> @inline_asm_8xi32_in_9v_def() {
28 %asm = call <8 x i32> asm sideeffect "; def $0", "={v[8:16]}"()
32 ; ERR: error: couldn't allocate input reg for constraint '{v[8:16]}'
33 define void @inline_asm_8xi32_in_9v_use(<8 x i32> %val) {
34 call void asm sideeffect "; use $0", "{v[8:16]}"(<8 x i32> %val)
38 ; ERR: error: couldn't allocate output register for constraint '{s[8:16]}'
39 define <8 x i32> @inline_asm_8xi32_in_9s_def() {
40 %asm = call <8 x i32> asm sideeffect "; def $0", "={s[8:16]}"()
45 ; Diagnose mismatched scalars with register ranges
47 ; ERR: error: couldn't allocate output register for constraint '{s[4:5]}'
48 define void @inline_asm_scalar_read_too_wide() {
49 %asm = call i32 asm sideeffect "; def $0 ", "={s[4:5]}"()
53 ; ERR: error: couldn't allocate output register for constraint '{s[4:4]}'
54 define void @inline_asm_scalar_read_too_narrow() {
55 %asm = call i64 asm sideeffect "; def $0 ", "={s[4:4]}"()
59 ; Single registers for vector types that are too wide or too narrow should be
62 ; ERR: error: couldn't allocate input reg for constraint '{v8}'
63 define void @inline_asm_4xi32_in_v_use(<4 x i32> %val) {
64 call void asm sideeffect "; use $0", "{v8}"(<4 x i32> %val)
68 ; ERR: error: couldn't allocate output register for constraint '{v8}'
69 define <4 x i32> @inline_asm_4xi32_in_v_def() {
70 %asm = call <4 x i32> asm sideeffect "; def $0", "={v8}"()
74 ; ERR: error: couldn't allocate output register for constraint '{s8}'
75 define <4 x i32> @inline_asm_4xi32_in_s_def() {
76 %asm = call <4 x i32> asm sideeffect "; def $0", "={s8}"()
80 ; ERR: error: couldn't allocate input reg for constraint '{v8}'
81 ; ERR: error: couldn't allocate input reg for constraint 'v'
82 define void @inline_asm_2xi8_in_v_use(<2 x i8> %val) {
83 call void asm sideeffect "; use $0", "{v8}"(<2 x i8> %val)
84 call void asm sideeffect "; use $0", "v"(<2 x i8> %val)
88 ; ERR: error: couldn't allocate output register for constraint '{v8}'
89 ; ERR: error: couldn't allocate output register for constraint 'v'
90 define <2 x i8> @inline_asm_2xi8_in_v_def() {
91 %phys = call <2 x i8> asm sideeffect "; def $0", "={v8}"()
92 %virt = call <2 x i8> asm sideeffect "; def $0", "=v"()
93 %r = and <2 x i8> %phys, %virt
97 ; ERR: error: couldn't allocate output register for constraint '{s8}'
98 ; ERR: error: couldn't allocate output register for constraint 's'
99 define <2 x i8> @inline_asm_2xi8_in_s_def() {
100 %phys = call <2 x i8> asm sideeffect "; def $0", "={s8}"()
101 %virt = call <2 x i8> asm sideeffect "; def $0", "=s"()
102 %r = and <2 x i8> %phys, %virt