[PATCH] D154738: [SLP]Introduce isLegalVectorOp to check if the vector instruction is going to be scalarized.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 10:45:09 PDT 2023


reames added a comment.

I don't understand why this patch is in terms of *legality*.  The lowering choices should already be reflected in the *cost* returned for these operations.  Why do we need to directly access the lowering choices rather than using the existing cost based APIs?

In particular, if an intermediate sub-tree is illegal, but the cost of lowering is low enough, then vectorizing the entire tree (if the total cost accounting shows that being profitable) is the right answer.  You're spending a huge amount of additional work to reclaim that ability by hard failing the vectorization.

It's not really clear to me what your motivating case here is, but I suspect you've got an inaccurate cost model for one of the illegal operations.  I'd strongly prefer fixing that rather than taking this approach.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154738



More information about the llvm-commits mailing list