[PATCH] D107009: [WIP][X86] combineX86ShuffleChain(): canonicalize mask elts picking from splats

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 07:19:34 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:35838
+  // This may allow to simplify the shuffle into a blend.
+  SmallVector<int> NewMask;
+  if (InputIsSplat[0] || InputIsSplat[1]) {
----------------
lebedev.ri wrote:
> RKSimon wrote:
> > Move this inside the if() ?
> This can't work, because `BaseMask` is an `ArrayRef`,
> so if we narrow the scope of `NewMask`,
> then we can't assign it to `BaseMask`,
> because that would result in use-after-scope.
> 
> Later in the function we have `SmallVector<int, 64> Mask;` with the same purpose,
> so the solution is to change the code inbetween to use `NewMask` instead of `BaseMask`,
> but that is a separate change that i will do afterwards.
OK - got it - cheers


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107009



More information about the llvm-commits mailing list