[PATCH] D13252: [InstCombine] Teach how to convert SSSE3/AVX2 byte shuffles to builtin shuffles if the shuffle mask is constant.

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 13:09:12 PDT 2015


spatel added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1185-1194
@@ +1184,12 @@
+        // control mask is set, then zero is written in the result byte.
+        if (Index.isNegative()) {
+          // The zero vector is in the right-hand side of the resulting
+          // shufflevector.
+          Indexes[I] = NumElts;
+          continue;
+        }
+       
+        // The value of each index is the least significant 4 bits of the
+        // shuffle control byte.
+        Indexes[I] = Index.getZExtValue() & 0xF;
+      }
----------------
If you use an int8_t instead of APInt for Index, does this become simpler?
   Indexes[I] = (Index < 0) ? NumElts : Index & 0xF;


http://reviews.llvm.org/D13252





More information about the llvm-commits mailing list