[PATCH] D13252: [InstCombine] Teach how to convert SSSE3/AVX2 byte shuffles to builtin shuffles if the shuffle mask is constant.
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 13:32:16 PDT 2015
andreadb 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;
+ }
----------------
spatel wrote:
> If you use an int8_t instead of APInt for Index, does this become simpler?
> Indexes[I] = (Index < 0) ? NumElts : Index & 0xF;
Yep. I will change it. Thanks.
http://reviews.llvm.org/D13252
More information about the llvm-commits
mailing list