[PATCH] Code Generator Patterns for X86 Gather and Scatter

Elena Demikhovsky elena.demikhovsky at intel.com
Tue Mar 3 00:43:26 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: ../include/llvm/Target/TargetSelectionDAG.td:199
@@ -198,1 +198,3 @@
 
+def SDTMaskedGather: SDTypeProfile<1, 3, [       // masked gather
+  SDTCisVec<0>, SDTCisSameAs<0, 1>, SDTCisVec<2>
----------------
craig.topper wrote:
> Why isn't this SDTypeProfile<2. 3  ?
I tie the second destination to the one of the sources and create an SDNode node with 3 sources and one destination. This way it works.
Otherwise I need to rewrite a half of the tablegen code.


================
Comment at: ../lib/Target/X86/X86InstrFragmentsSIMD.td:294
@@ -293,1 +293,3 @@
 def X86rcp28s    : SDNode<"X86ISD::RCP28",    STDFp2SrcRm>;
+def X86mgather   : SDNode<"X86ISD::GATHER", SDTypeProfile<1, 3, 
+                                   [SDTCisVec<0>, SDTCisVec<1>, SDTCisVec<2>]>>;
----------------
craig.topper wrote:
> This doesn't appear to be used.
You are right, I'll remove it, thanks.

================
Comment at: ../lib/Target/X86/X86InstrFragmentsSIMD.td:499
@@ +498,3 @@
+  (masked_gather node:$src1, node:$src2, node:$src3) , [{
+  //if (MaskedGatherSDNode *Mgt = dyn_cast<MaskedGatherSDNode>(N))
+  //  return (Mgt->getIndex().getValueType() == MVT::v8i32 ||
----------------
craig.topper wrote:
> Why so much commented out code?
This is the real code that will go in. I have the full implementation of the feature including tests, and trying to split it now into small patches for review.

================
Comment at: ../lib/Target/X86/X86InstrInfo.td:723
@@ +722,3 @@
+def vectoraddr : ComplexPattern<iPTR, 5, "SelectAddr", [],[SDNPWantParent]>;
+//def vectoraddr : ComplexPattern<iPTR, 5, "SelectVectorAddr", [],[SDNPWantParent]>;
+
----------------
craig.topper wrote:
> Why is this commented out?
I don't want to put implementation of SelectVectorAddr() in this patch. I just show that the vectoraddr is a special complex pattern that has its own implementation.

================
Comment at: ../utils/TableGen/CodeGenDAGPatterns.cpp:1623
@@ +1622,3 @@
+      TreePatternNode *Set2Val = getChild(NC-2);
+      MadeChange = Set2Val->ApplyTypeConstraints(TP, NotRegisters);
+      NumOfSrcs --;
----------------
craig.topper wrote:
> Shouldn't this be  "MadeChange |="   as it is it overwrites the change from the first call.
You are right, thanks.

================
Comment at: ../utils/TableGen/CodeGenDAGPatterns.cpp:1624
@@ +1623,3 @@
+      MadeChange = Set2Val->ApplyTypeConstraints(TP, NotRegisters);
+      NumOfSrcs --;
+    }
----------------
craig.topper wrote:
> Remove space before the --.
Ok.

http://reviews.llvm.org/D7665

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list