[PATCH] D115757: [SLP]Generalize cost model.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 08:53:31 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6059
+             "Expected undef or GEP.");
+      return true;
+    }
----------------
return isa<UndefValue>(V)?


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5840
+    if (!I)
+      return true;
     auto *Op = cast<Instruction>(V)->getOperand(OpIdx);
----------------
ABataev wrote:
> RKSimon wrote:
> > true?
> Here is my idea. Generally speaking, here we can have only undef/poison or just a pointer (as part of getelementpr node) currently (maybe, need to add an assert). I thought that because of that we can treat its (virtual) operand as power-of-2, since it can be any value. Thoughts?
Still not sure about this - this undef case is fine, but the GEP I can imagine might not work in all special cases.

How good is return isa<UndefValue>(V); instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115757



More information about the llvm-commits mailing list