[PATCH] D143662: [AMDGPU] Refactor multiclass FLAT_Atomic_Pseudo. NFC.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 08:33:57 PST 2023
foad created this revision.
foad added reviewers: AMDGPU, piotr, rampitec.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
This is just for consistency with FLAT_Global_Atomic_Pseudo.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143662
Files:
llvm/lib/Target/AMDGPU/FLATInstructions.td
Index: llvm/lib/Target/AMDGPU/FLATInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -466,7 +466,7 @@
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 @@
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<
+ 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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143662.496146.patch
Type: text/x-patch
Size: 1555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230209/98579437/attachment.bin>
More information about the llvm-commits
mailing list