[llvm] [AMDGPU][MC] Disable sendmsg SYSMSG_OP_HOST_TRAP_ACK on gfx9+ (PR #90203)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 05:45:15 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mc
Author: Emma Pilkington (epilk)
<details>
<summary>Changes</summary>
This is no longer supported as of gfx9. Fixes #<!-- -->52903
---
Full diff: https://github.com/llvm/llvm-project/pull/90203.diff
4 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (+3-1)
- (modified) llvm/test/MC/AMDGPU/gfx9-asm-err.s (+3)
- (modified) llvm/test/MC/AMDGPU/sopp-err.s (+4)
- (modified) llvm/test/MC/AMDGPU/sopp-gfx9.s (+3)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 4e0074451aa58c..63b6cdec105769 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -1953,7 +1953,9 @@ bool isValidMsgOp(int64_t MsgId, int64_t OpId, const MCSubtargetInfo &STI,
return 0 <= OpId && isUInt<OP_WIDTH_>(OpId);
if (MsgId == ID_SYSMSG)
- return OP_SYS_FIRST_ <= OpId && OpId < OP_SYS_LAST_;
+ return OP_SYS_FIRST_ <= OpId && OpId < OP_SYS_LAST_ &&
+ (!isGFX9Plus(STI) || OpId != OP_SYS_HOST_TRAP_ACK);
+
if (!isGFX11Plus(STI)) {
switch (MsgId) {
case ID_GS_PreGFX11:
diff --git a/llvm/test/MC/AMDGPU/gfx9-asm-err.s b/llvm/test/MC/AMDGPU/gfx9-asm-err.s
index 93138a82918504..bb87898730c54d 100644
--- a/llvm/test/MC/AMDGPU/gfx9-asm-err.s
+++ b/llvm/test/MC/AMDGPU/gfx9-asm-err.s
@@ -41,3 +41,6 @@ global_load_dword v[2:3], off
scratch_load_dword v2, off, offset:256
// GFX9ERR: :[[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
+
+s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_HOST_TRAP_ACK)
+// GFX9ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operation id
diff --git a/llvm/test/MC/AMDGPU/sopp-err.s b/llvm/test/MC/AMDGPU/sopp-err.s
index bd044cb7434025..b0ff379251dec4 100644
--- a/llvm/test/MC/AMDGPU/sopp-err.s
+++ b/llvm/test/MC/AMDGPU/sopp-err.s
@@ -199,6 +199,10 @@ s_sendmsg sendmsg(MSG_SYSMSG, 0)
s_sendmsg sendmsg(MSG_SYSMSG, 5)
// GCN: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operation id
+s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_HOST_TRAP_ACK)
+// GFX10: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operation id
+// GFX11PLUS: :[[@LINE-2]]:{{[0-9]+}}: error: invalid operation id
+
//===----------------------------------------------------------------------===//
// waitcnt
//===----------------------------------------------------------------------===//
diff --git a/llvm/test/MC/AMDGPU/sopp-gfx9.s b/llvm/test/MC/AMDGPU/sopp-gfx9.s
index e760d497896fa5..2ba6d0043f35e6 100644
--- a/llvm/test/MC/AMDGPU/sopp-gfx9.s
+++ b/llvm/test/MC/AMDGPU/sopp-gfx9.s
@@ -109,3 +109,6 @@ s_sendmsg 10
s_sendmsg sendmsg(MSG_GET_DOORBELL)
// GFX9: s_sendmsg sendmsg(MSG_GET_DOORBELL) ; encoding: [0x0a,0x00,0x90,0xbf]
+
+s_sendmsg sendmsg(15, 3, 0)
+// GFX9: s_sendmsg sendmsg(15, 3, 0) ; encoding: [0x3f,0x00,0x90,0xbf]
``````````
</details>
https://github.com/llvm/llvm-project/pull/90203
More information about the llvm-commits
mailing list