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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 07:37:58 PDT 2015


mkuper added inline comments.

================
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.
----------------
RKSimon wrote:
> 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.
Of course, I definitely didn't mean that should be part of this patch.
(Also, I misread the code, it was a silly question to begin with, sorry for the noise.)


Repository:
  rL LLVM

http://reviews.llvm.org/D11938





More information about the llvm-commits mailing list