[PATCH] D108703: [SLP]No need to schedule/check parent for extract{element/value} instruction.

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 08:23:06 PDT 2021


anton-afanasyev added a comment.

Please rebase against `llvm/test/Transforms/SLPVectorizer/X86/extract_with_non_const_index.ll` commited at aaae726afb0ef <https://reviews.llvm.org/rGaaae726afb0efdac9867972ec0c5d544a637407a>.



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:221
+    return false;
+  if (isa<ExtractElementInst, ExtractValueInst>(I))
+    return isConstant(I->getOperand(1));
----------------
ABataev wrote:
> anton-afanasyev wrote:
> > Btw, this second `ExtractValueInst` is redundant, it's checked above.
> No, it is required and checks for a different thing. It checks that the index is constant for such instructions.
But you've made check already at line 217, haven't you? Return true for any index if `isa<ExtractValueInst>(I)`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108703



More information about the llvm-commits mailing list