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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 08:25:03 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:221
+    return false;
+  if (isa<ExtractElementInst, ExtractValueInst>(I))
+    return isConstant(I->getOperand(1));
----------------
anton-afanasyev wrote:
> 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)`.
Oh, yes, missed that you meant `ExtractValueInst`. Yes, need to remove the check for `ExtractValueInst` here, it cannot have non-const indices per LLVM IR specification.


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