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

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 06:31:04 PDT 2015


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

A couple of minor things but otherwise LGTM. Thanks Andrea!


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1197
@@ +1196,3 @@
+    for (unsigned I = 16; I < NumElts; ++I)
+      Indexes[I] += 16;
+
----------------
I'm worried this is hardcoded to the AVX2 '32 element' implementation (so if the AVX512 intrinsic ever gets supported here...)

You could possibly merge this into the code above:

Indexes[I] = (I & ~0xF) + ((Index < 0) ? NumElts : (Index & 0xF))

================
Comment at: test/Transforms/InstCombine/x86-pshufb.ll:2
@@ +1,3 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+; Verify that instcombine is able to fold identity shuffles.
----------------
You have a decent range of tests here already - the only addition I can think of would be to show that some 'strange value' pshufb indices (i.e. not -128 or 0-15 or 0-31) get correctly masked based on their bits.


http://reviews.llvm.org/D13252





More information about the llvm-commits mailing list