Skip to content

Commit 1d610fd

Browse files
committed
Test for unsupported dgvpr on w64
1 parent f685823 commit 1d610fd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,11 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
37323732
return lowerUnhandledCall(CLI, InVals, "Expected 3 additional args");
37333733
}
37343734

3735+
if (!Subtarget->isWave32()) {
3736+
return lowerUnhandledCall(
3737+
CLI, InVals, "Dynamic VGPR mode is only supported for wave32");
3738+
}
3739+
37353740
UsesDynamicVGPRs = true;
37363741
std::for_each(CLI.Args.begin() + ChainCallArgIdx::NumVGPRs,
37373742
CLI.Args.end(), PushNodeOrTargetConstant);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: not --crash llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -global-isel=1 -mattr=+wavefrontsize64 -verify-machineinstrs=0 < %s 2>&1 | FileCheck %s
2+
; RUN: not llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -global-isel=0 -mattr=+wavefrontsize64 -verify-machineinstrs=0 < %s 2>&1 | FileCheck %s
3+
4+
declare amdgpu_cs_chain void @callee() nounwind
5+
6+
; CHECK: in function test_dvgpr void (): Dynamic VGPR mode is only supported for wave32
7+
define amdgpu_cs_chain void @test_dvgpr() {
8+
call void(ptr, i64, i32, i32, i32, ...) @llvm.amdgcn.cs.chain(ptr @callee, i64 -1, i32 inreg 1, i32 2, i32 1, i32 inreg 32, i32 inreg -1, ptr @callee)
9+
unreachable
10+
}
11+

0 commit comments

Comments
 (0)