[PATCH] D33225: [PowerPC] Fix a performance bug for PPC::XXSLDWI.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 17:36:25 PDT 2017


timshen added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1667
 
+/// Possible LE ShuffleVector masks (Case 1):
+/// ShuffleVector((vector int)a, vector(int)b, 0, 1, 2, 3)
----------------
nemanjai wrote:
> Although I appreciate the effort, we can't really have comments enumerating all the possible shuffles that a specific instruction can take. As you can imagine, doing so for all the different instruction handling specific shuffle types would blow up into thousands of lines of comments.
> 
> Besides, the enumeration does seem to be missing some. For example a shuffle mask of `3,0,1,2` does not appear to be listed and should be valid (i.e. shift a vector concatenated with itself left by one word).
On the bright side, this can be turned into really good test cases.

You can use llvm/util/update_llc_test_checks.py to generate CHECK lines.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1689
+/// ShuffleVector((vector int)a, vector(int)a, 0, 1, 2, 3)
+/// ShuffleVector((vector int)a, vector(int)a, 1, 2, 3, 0)
+/// ShuffleVector((vector int)a, vector(int)a, 2, 3, 0, 1)
----------------
FWIW GCC gives:
0 1 2 3 
3 0 1 2 
2 3 0 1 
1 2 3 0 



https://reviews.llvm.org/D33225





More information about the llvm-commits mailing list