[PATCH] D22889: [X86] Match PSADBW in straight-line code

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 09:58:42 PDT 2016


RKSimon added a comment.

Is there much scope to share more of the code with combineLoopSADPattern?


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:26461
@@ +26460,3 @@
+    return SDValue();
+
+  // Verify the extract is from index 0.
----------------
To support wider types is there any way that you can split the vector, perform PSAD on both and then combine the 2 results?

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:26500
@@ +26499,3 @@
+    // Verify the shuffle has the expected (at this stage of the pyramid) mask.
+    int MaskEnd = 1 << i;
+    for (int Index = 0; Index < MaskEnd; ++Index)
----------------
Minor, but move this into the for() loop's initializer?

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:26529
@@ +26528,3 @@
+      unsigned MaskEnd = 1 << (i - 1);
+      for(unsigned j = 0; j < MaskEnd; ++j)
+        Mask[j] = MaskEnd + j;
----------------
Move into for loop


https://reviews.llvm.org/D22889





More information about the llvm-commits mailing list