[llvm] d6c3d79 - [AMDGPU] Refactor multiclass FLAT_Atomic_Pseudo. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 13:14:50 PST 2023
Author: Jay Foad
Date: 2023-02-09T21:14:43Z
New Revision: d6c3d7924feee04f14f7423e506d8a1c79832ef0
URL: https://github.com/llvm/llvm-project/commit/d6c3d7924feee04f14f7423e506d8a1c79832ef0
DIFF: https://github.com/llvm/llvm-project/commit/d6c3d7924feee04f14f7423e506d8a1c79832ef0.diff
LOG: [AMDGPU] Refactor multiclass FLAT_Atomic_Pseudo. NFC.
This is just for consistency with FLAT_Global_Atomic_Pseudo.
Differential Revision: https://reviews.llvm.org/D143662
Added:
Modified:
llvm/lib/Target/AMDGPU/FLATInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/FLATInstructions.td b/llvm/lib/Target/AMDGPU/FLATInstructions.td
index d5c44f985f9e2..6972afebf8c47 100644
--- a/llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ b/llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -466,7 +466,7 @@ class FLAT_AtomicRet_Pseudo<string opName, dag outs, dag ins,
let PseudoInstr = NAME # "_RTN";
}
-multiclass FLAT_Atomic_Pseudo<
+multiclass FLAT_Atomic_Pseudo_NO_RTN<
string opName,
RegisterClass vdst_rc,
ValueType vt,
@@ -484,7 +484,16 @@ multiclass FLAT_Atomic_Pseudo<
let FPAtomic = isFP;
let AddedComplexity = -1; // Prefer global atomics if available
}
+}
+multiclass FLAT_Atomic_Pseudo_RTN<
+ string opName,
+ RegisterClass vdst_rc,
+ ValueType vt,
+ ValueType data_vt = vt,
+ RegisterClass data_rc = vdst_rc,
+ bit isFP = isFloatType<data_vt>.ret,
+ RegisterOperand data_op = getLdStRegisterOperand<data_rc>.ret> {
def _RTN : FLAT_AtomicRet_Pseudo <opName,
(outs getLdStRegisterOperand<vdst_rc>.ret:$vdst),
(ins VReg_64:$vaddr, data_op:$vdata, flat_offset:$offset, CPol_GLC1:$cpol),
@@ -496,6 +505,18 @@ multiclass FLAT_Atomic_Pseudo<
}
}
+multiclass FLAT_Atomic_Pseudo<
+ string opName,
+ RegisterClass vdst_rc,
+ ValueType vt,
+ ValueType data_vt = vt,
+ RegisterClass data_rc = vdst_rc,
+ bit isFP = isFloatType<data_vt>.ret,
+ RegisterOperand data_op = getLdStRegisterOperand<data_rc>.ret> {
+ defm "" : FLAT_Atomic_Pseudo_NO_RTN<opName, vdst_rc, vt, data_vt, data_rc, isFP, data_op>;
+ defm "" : FLAT_Atomic_Pseudo_RTN<opName, vdst_rc, vt, data_vt, data_rc, isFP, data_op>;
+}
+
multiclass FLAT_Global_Atomic_Pseudo_NO_RTN<
string opName,
RegisterClass vdst_rc,
More information about the llvm-commits
mailing list