[PATCH] D31509: [InstCombine] Combine vector shuffles if the same operand can be reused

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 07:58:07 PDT 2017


spatel added subscribers: efriedma, jnspaulsson, mssimpso.
spatel added a comment.

The revert message doesn't give us any details about what went wrong:
https://reviews.llvm.org/rL180834

cc'ing @efriedma @mssimpso @jnspaulsson 
This would help PR30630?
https://bugs.llvm.org/show_bug.cgi?id=30630



================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1438-1439
 
   // If the result mask is equal to one of the original shuffle masks,
   // or is a splat, do the replacement.
+  if (isSplat || newMask == LHSMask || newMask == RHSMask || newMask == Mask ||
----------------
Please update the comment for the new possibility.


================
Comment at: test/Transforms/InstCombine/vec_shuffle.ll:467-471
+define <8 x double> @shuffle_after_wide_load(double* %ptr) #0 {
+  %a = bitcast double* %ptr to <8 x double>*
+  %1 = load <8 x double>, <8 x double>* %a, align 16
+; CHECK-LABEL: @shuffle_after_wide_load
+; CHECK-NOT: shufflevector
----------------
The test should not require a load; pass the input vector in as a parameter?
Also, please use the script:
"NOTE: Assertions have been autogenerated by utils/update_test_checks.py"
instead of hand-editing CHECK lines.

The script was updated after the checks in this file were generated, so the path of least resistance will be to use the '--function=shuffle_after_wide_load' parameter to not induce a bunch of unrelated changes.


https://reviews.llvm.org/D31509





More information about the llvm-commits mailing list