Closed
Description
In emitCSRSpillStores
, a caller-saved SGPR is required to save exec
, which limits us to using SGPR0 through SGPR29. Currently, we assume that one is always available; however, this isn’t always the case, as SGPR0 to SGPR29 are also used for inreg
argument passing.
If there are enough inreg
arguments, no SGPR is available, leading to a compiler crash. The following example demonstrates this issue.
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 %s -o -
declare hidden void @external_void_func_a15i32_inreg([16 x i32] inreg)
define void @test_call_external_void_func_a15i32_inreg([16 x i32] inreg %arg0) {
call void @external_void_func_a15i32_inreg([16 x i32] inreg %arg0)
ret void
}