[PATCH] D37594: AMDGPU: Start using !con operator

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 14:37:54 PDT 2017


arsenm created this revision.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, kzhuravl.

We have a lot of operand definition work essentially producing
every valid permutation of operands to workaround builiding
operand lists based on the instruction features. Apparently tablegen
already has a mostly undocumented operator to concat dags which
simplies this.

      

Convert one simple place to use this. The BUF instruction definitions
have much more complicated logic that can be totally rewritten now.


https://reviews.llvm.org/D37594

Files:
  lib/Target/AMDGPU/FLATInstructions.td


Index: lib/Target/AMDGPU/FLATInstructions.td
===================================================================
--- lib/Target/AMDGPU/FLATInstructions.td
+++ lib/Target/AMDGPU/FLATInstructions.td
@@ -128,13 +128,12 @@
   bit HasSignedOffset = 0, bit HasSaddr = 0, bit EnableSaddr = 0> : FLAT_Pseudo<
   opName,
   (outs regClass:$vdst),
-  !if(EnableSaddr,
-    !if(HasSignedOffset,
-      (ins VReg_64:$vaddr, SReg_64:$saddr, offset_s13:$offset, GLC:$glc, slc:$slc),
-      (ins VReg_64:$vaddr, SReg_64:$saddr, offset_u12:$offset, GLC:$glc, slc:$slc)),
-    !if(HasSignedOffset,
-      (ins VReg_64:$vaddr, offset_s13:$offset, GLC:$glc, slc:$slc),
-      (ins VReg_64:$vaddr, offset_u12:$offset, GLC:$glc, slc:$slc))),
+  !con(
+    !con(
+      !con((ins VReg_64:$vaddr),
+        !if(EnableSaddr, (ins SReg_64:$saddr), (ins))),
+          (ins !if(HasSignedOffset,offset_s13,offset_u12):$offset)),
+          (ins GLC:$glc, slc:$slc)),
   " $vdst, $vaddr"#!if(HasSaddr, !if(EnableSaddr, ", $saddr", ", off"), "")#"$offset$glc$slc"> {
   let has_data = 0;
   let mayLoad = 1;
@@ -148,13 +147,12 @@
   bit HasSignedOffset = 0, bit HasSaddr = 0, bit EnableSaddr = 0> : FLAT_Pseudo<
   opName,
   (outs),
-  !if(EnableSaddr,
-      !if(HasSignedOffset,
-        (ins VReg_64:$vaddr, vdataClass:$vdata, SReg_64:$saddr, offset_s13:$offset, GLC:$glc, slc:$slc),
-        (ins VReg_64:$vaddr, vdataClass:$vdata, SReg_64:$saddr, offset_u12:$offset, GLC:$glc, slc:$slc)),
-    !if(HasSignedOffset,
-      (ins VReg_64:$vaddr, vdataClass:$vdata, offset_s13:$offset, GLC:$glc, slc:$slc),
-      (ins VReg_64:$vaddr, vdataClass:$vdata, offset_u12:$offset, GLC:$glc, slc:$slc))),
+  !con(
+    !con(
+      !con((ins VReg_64:$vaddr, vdataClass:$vdata),
+        !if(EnableSaddr, (ins SReg_64:$saddr), (ins))),
+          (ins !if(HasSignedOffset,offset_s13,offset_u12):$offset)),
+          (ins GLC:$glc, slc:$slc)),
   " $vaddr, $vdata"#!if(HasSaddr, !if(EnableSaddr, ", $saddr", ", off"), "")#"$offset$glc$slc"> {
   let mayLoad  = 0;
   let mayStore = 1;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37594.114259.patch
Type: text/x-patch
Size: 2049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170907/e1521249/attachment.bin>


More information about the llvm-commits mailing list