[PATCH] D14261: [X86][SSE] Detect zeroable shuffle elements from different value types

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 07:53:01 PDT 2016


chandlerc accepted this revision.
chandlerc added a comment.
This revision is now accepted and ready to land.

FWIW, this looks really nice now. Nits below, LGTM with suggested changes.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:7249-7250
@@ -7248,1 +7248,4 @@
 
+  unsigned VectorSizeInBits = V1.getValueType().getSizeInBits();
+  unsigned ScalarSizeInBits = VectorSizeInBits / Mask.size();
+  assert(!(VectorSizeInBits % ScalarSizeInBits) && "Illegal shuffle mask size");
----------------
Please just use 'int' unless you need modular arithmetic...

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:7272
@@ +7271,3 @@
+    if ((Size % V.getNumOperands()) == 0) {
+      unsigned Scale = Size / V->getNumOperands();
+      SDValue Op = V.getOperand(M / Scale);
----------------
int here as well.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:7293-7295
@@ +7292,5 @@
+    if ((V.getNumOperands() % Size) == 0) {
+      unsigned Scale = V->getNumOperands() / Size;
+      bool AllZeroable = true;
+      for (unsigned j = 0; j != Scale; ++j) {
+        SDValue Op = V.getOperand((M * Scale) + j);
----------------
int here, and j < Scale.


Repository:
  rL LLVM

http://reviews.llvm.org/D14261





More information about the llvm-commits mailing list