This test case uses an <8 x i32> width physical register constraint, but tries to use it as a <9 x i32> typed value. This should just be an error, but it results in an assertion in SelectionDAGBuilder.
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s
define <9 x i32> @inline_asm_wrong_vector_type_assert_def() {
%asm = call <9 x i32> asm sideeffect "; def $0", "={v[8:15]}"()
ret <9 x i32> %asm
}
define void @inline_asm_wrong_vector_type_assert_use(<9 x i32> %val) {
call void asm sideeffect "; use $0", "{v[8:15]}"(<9 x i32> %val)
ret void
}
Hits this assertion:
Assertion failed: ((PartEVT.getVectorElementCount().getKnownMinValue() > ; ValueVT.getVectorElementCount().getKnownMinValue()) && (PartEVT.getVectorElementCount().isScalable() == ValueVT.getVectorElementCount().isScalable()) && "Cannot narrow, it would be a lossy transformation"), function getCopyFromPartsVector, file SelectionDAGBuilder.cpp, line 430.
Another similar failure happens if the result is a scalar:
define void @asm_assert_scalar_read_vector() {
%asm = call i32 asm sideeffect "; def $0 ", "={s[4:5]}"()
ret void
}
This test case uses an <8 x i32> width physical register constraint, but tries to use it as a <9 x i32> typed value. This should just be an error, but it results in an assertion in SelectionDAGBuilder.
Hits this assertion:
Assertion failed: ((PartEVT.getVectorElementCount().getKnownMinValue() > ; ValueVT.getVectorElementCount().getKnownMinValue()) && (PartEVT.getVectorElementCount().isScalable() == ValueVT.getVectorElementCount().isScalable()) && "Cannot narrow, it would be a lossy transformation"), function getCopyFromPartsVector, file SelectionDAGBuilder.cpp, line 430.Another similar failure happens if the result is a scalar: