[llvm] AMDGPU: Remove incorrect uses of SubtaretPredicate around DS_Reals (PR #85001)
Changpeng Fang via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 17:21:25 PDT 2024
https://github.com/changpeng created https://github.com/llvm/llvm-project/pull/85001
SubtargetPredicate is copied from DS_Pseudo to DS_Real. We should not use another SubtargetPredicate around DS_Real, because doing this will override the predicate from DS_Pseudo.
For examle, for DS_ADD_RTN_F64, SubtargetPredicate was set to HasLdsAtomicAddF64 in Pseudo. And it will be overriden to isGFX90APlus if we assign isGFX90APlus to SubtargetPredicate in Real definition.
>From 8f2e2e2bfec4c71e8a51d28911916a3b39051bc1 Mon Sep 17 00:00:00 2001
From: Changpeng Fang <changpeng.fang at amd.com>
Date: Tue, 12 Mar 2024 17:10:52 -0700
Subject: [PATCH] AMDGPU: Remove incorrect uses of SubtaretPredicate around
DS_Reals
SubtargetPredicate is copied from DS_Pseudo to DS_Real. We should
not use another SubtargetPredicate around DS_Real, because doing this
will override the predicate from DS_Pseudo.
For examle, for DS_ADD_RTN_F64, SubtargetPredicate was set to
HasLdsAtomicAddF64 in Pseudo. And it will be overriden to isGFX90APlus
if we assign isGFX90APlus to SubtargetPredicate in Real definition.
---
llvm/lib/Target/AMDGPU/DSInstructions.td | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td
index 87ace01a6d0e56..b869a1a12f5d29 100644
--- a/llvm/lib/Target/AMDGPU/DSInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSInstructions.td
@@ -1735,14 +1735,12 @@ def DS_WRITE_B128_vi : DS_Real_vi<0xdf, DS_WRITE_B128>;
def DS_READ_B96_vi : DS_Real_vi<0xfe, DS_READ_B96>;
def DS_READ_B128_vi : DS_Real_vi<0xff, DS_READ_B128>;
-let SubtargetPredicate = isGFX90APlus in {
- def DS_ADD_F64_vi : DS_Real_vi<0x5c, DS_ADD_F64>;
- def DS_ADD_RTN_F64_vi : DS_Real_vi<0x7c, DS_ADD_RTN_F64>;
-} // End SubtargetPredicate = isGFX90APlus
-
-let SubtargetPredicate = isGFX940Plus in {
- def DS_PK_ADD_F16_vi : DS_Real_vi<0x17, DS_PK_ADD_F16>;
- def DS_PK_ADD_RTN_F16_vi : DS_Real_vi<0xb7, DS_PK_ADD_RTN_F16>;
- def DS_PK_ADD_BF16_vi : DS_Real_vi<0x18, DS_PK_ADD_BF16>;
- def DS_PK_ADD_RTN_BF16_vi : DS_Real_vi<0xb8, DS_PK_ADD_RTN_BF16>;
-} // End SubtargetPredicate = isGFX940Plus
+// GFX90A
+def DS_ADD_F64_vi : DS_Real_vi<0x5c, DS_ADD_F64>;
+def DS_ADD_RTN_F64_vi : DS_Real_vi<0x7c, DS_ADD_RTN_F64>;
+
+// GFX940
+def DS_PK_ADD_F16_vi : DS_Real_vi<0x17, DS_PK_ADD_F16>;
+def DS_PK_ADD_RTN_F16_vi : DS_Real_vi<0xb7, DS_PK_ADD_RTN_F16>;
+def DS_PK_ADD_BF16_vi : DS_Real_vi<0x18, DS_PK_ADD_BF16>;
+def DS_PK_ADD_RTN_BF16_vi : DS_Real_vi<0xb8, DS_PK_ADD_RTN_BF16>;
More information about the llvm-commits
mailing list