[PATCH] D109065: [X86] combineX86ShufflesRecursively(): call SimplifyMultipleUseDemandedVectorElts() on after finishing recursing

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 03:29:04 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:37553
+  unsigned NumElts = DemandedElts.getBitWidth();
+  unsigned NumSrcElts = SrcDemandedElts.getBitWidth();
+
----------------
RKSimon wrote:
> We should assert that (NumElts % NumSrcElts) == 0 || (NumSrcElts % NumElts) == 0 - or return true/false on success/failure.
Oops, i meant to do that, but forgot to in the end.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:37911
+
+    unsigned NumOpElts = Op.getValueType().getVectorNumElements();
+
----------------
RKSimon wrote:
> lebedev.ri wrote:
> > RKSimon wrote:
> > > lebedev.ri wrote:
> > > > RKSimon wrote:
> > > > > Op might be a different width to the Root - see the "Widen any subvector shuffle inputs we've collected." code below.
> > > > I keep hitting the same pitfail.
> > > We still need to do this before the widenSubVector() code - otherwise we'll never be able to simplify any input that doesn't match RootSizeInBits, which are likely to be the most interesting cases imo.
> > I agree, but is this a correctness concern for this patch?
> what correctness?
I mean, if we don't do this in this patch, will that lead to miscompiles, or simply to missed optimizations?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109065



More information about the llvm-commits mailing list