[llvm] Split vgpr regalloc pipeline (PR #93526)
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 06:17:19 PDT 2024
================
@@ -0,0 +1,17 @@
+; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=-flat-for-global -stress-regalloc=3 -filetype=null %s 2>&1 | FileCheck %s
+
+; A negative test to capture the expected error when the VGPRs are insufficient for wwm-regalloc.
+
+; CHECK: error: can't find enough VGPRs for wwm-regalloc
+
+define amdgpu_kernel void @test() #0 {
+ call void asm sideeffect "", "~{v[0:1]}" ()
+ %val0 = call i32 asm sideeffect "; def $0", "=s" ()
+ %val1 = call i32 asm sideeffect "; def $0", "=s" ()
+ store i32 10, ptr addrspace(1) null
+ call void asm sideeffect "; use $0", "s"(i32 %val0)
+ call void asm sideeffect "; use $0", "s"(i32 %val1)
+ ret void
+}
+
+attributes #0 = { nounwind "amdgpu-num-vgpr"="2"}
----------------
cdevadas wrote:
The `stress-regalloc` is a niche way to restrict only the AllocationOrder. It is visible only to RegisterClassInfo.cpp design and not useful to constrain the register numbers elsewhere. So, `getMaxNumVGPRs` doesn't incorporate it at all. I should otherwise clobber all available VGPRs via inline ASM to make them unavailable.
https://github.com/llvm/llvm-project/pull/93526
More information about the llvm-commits
mailing list