[PATCH] D81791: [X86][SSE] Add SimplifyDemandedVectorEltsForTargetShuffle to handle target shuffle variable masks.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 00:33:34 PDT 2020


craig.topper added a subscriber: yubing.
craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:36727
+  unsigned NumCstElts = cast<FixedVectorType>(C->getType())->getNumElements();
+  if (NumCstElts != NumElts && NumCstElts != (NumElts * 2))
+    return false;
----------------
RKSimon wrote:
> craig.topper wrote:
> > I think this check isn't enough if the load is narrower than the constant pool vector. For example a v16i8 load with a v32i8 constant pool. So NumCstElts == NumElts * 2 and we'll proceed.
> > 
> > I think this is the cause of some failures we're seeing, but I don't have a reduced case yet.
> Does checking that Mask.getValueSizeInBits() == C->getSizeInBits() as well help?
Yeah I ended up trying that right after I wrote my earlier message. That fixed the failing tests we had. I think we may have a reduced test case now. @pengfei or @yubing can you share it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81791/new/

https://reviews.llvm.org/D81791





More information about the llvm-commits mailing list