[PATCH] D11938: [InstCombine] SSE/AVX vector shifts demanded shift amount bits

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 07:35:26 PDT 2015


RKSimon added a comment.

Thanks Michael.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:259
@@ -214,3 +258,3 @@
   if (CDV) {
     // SSE2/AVX2 uses all the first 64-bits of the 128-bit vector
     // operand to compute the shift amount.
----------------
mkuper wrote:
> Could this code also be replaced by a call to SimplifyDemandedVectorElts(), to remove duplication? Or does it do something smarter?
AFAICT SimplifyDemandedVectorElts doesn't help us here - what we'd really need is a helper function that bitcasts a ConstantDataVector and we get the raw APInt values. There is similar code in ConstantFolding.cpp (and DAGCombiner::ConstantFoldBITCASTofBUILD_VECTOR) so it isn't out of the question but beyond the scope of this patch.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:876
@@ +875,3 @@
+
+    // SSE2/AVX2 only uses all the first 64-bits of the 128-bit vector
+    // operand to compute the shift amount.
----------------
mkuper wrote:
> all -> only?
OK.


Repository:
  rL LLVM

http://reviews.llvm.org/D11938





More information about the llvm-commits mailing list