[PATCH] D72122: AMDGPU: Only allow regs for s_movrel_{b32|b64}
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 18:06:47 PST 2020
arsenm created this revision.
arsenm added reviewers: rampitec, kerbowa, dp, vpykhtin.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
This would incorrectly allowing folding immediates. These currently
aren't selectable, but will be from GlobalISel soon.
https://reviews.llvm.org/D72122
Files:
llvm/lib/Target/AMDGPU/SOPInstructions.td
Index: llvm/lib/Target/AMDGPU/SOPInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -85,6 +85,11 @@
let Constraints = !if(tied_in, "$sdst = $sdst_in", "");
}
+// Only register input allowed.
+class SOP1_32R <string opName, list<dag> pattern=[]> : SOP1_Pseudo <
+ opName, (outs SReg_32:$sdst), (ins SReg_32:$src0),
+ "$sdst, $src0", pattern>;
+
// 32-bit input, no output.
class SOP1_0_32 <string opName, list<dag> pattern = []> : SOP1_Pseudo <
opName, (outs), (ins SSrc_b32:$src0),
@@ -103,6 +108,12 @@
"$sdst, $src0", pattern
>;
+// Only register input allowed.
+class SOP1_64R <string opName, list<dag> pattern=[]> : SOP1_Pseudo <
+ opName, (outs SReg_64:$sdst), (ins SReg_64:$src0),
+ "$sdst, $src0", pattern
+>;
+
// 64-bit input, 32-bit output.
class SOP1_32_64 <string opName, list<dag> pattern=[]> : SOP1_Pseudo <
opName, (outs SReg_32:$sdst), (ins SSrc_b64:$src0),
@@ -254,8 +265,8 @@
def S_QUADMASK_B64 : SOP1_64 <"s_quadmask_b64">;
let Uses = [M0] in {
-def S_MOVRELS_B32 : SOP1_32 <"s_movrels_b32">;
-def S_MOVRELS_B64 : SOP1_64 <"s_movrels_b64">;
+def S_MOVRELS_B32 : SOP1_32R <"s_movrels_b32">;
+def S_MOVRELS_B64 : SOP1_64R <"s_movrels_b64">;
def S_MOVRELD_B32 : SOP1_32 <"s_movreld_b32">;
def S_MOVRELD_B64 : SOP1_64 <"s_movreld_b64">;
} // End Uses = [M0]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72122.235982.patch
Type: text/x-patch
Size: 1433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200103/c2b5179f/attachment.bin>
More information about the llvm-commits
mailing list