[PATCH] D152600: [InstCombine] Add target option to bail scalarization

Hendrik Greving via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 08:57:39 PDT 2023


hgreving added a comment.

In D152600#4410907 <https://reviews.llvm.org/D152600#4410907>, @nikic wrote:

> InstCombine is a target-independent canonicalization pass. The use of TTI hooks is forbidden as a matter of policy.
>
> If there is no subset of scalarization that is universally profitable, then the transform should be moved into VectorCombine, which is cost-model driven.

I expected this kind of reply, I felt though that TTI is already used in some cases. If it's strictly target independent, I don't understand why we would scalarize in instcombine in the first place, since this is very unlikely to be target agnostic. Would you be ok with a switch (probably not)? The only problem with moving it to vector-combine is that besides scalarize phi, it seems entangled with extract_elt transforms that _are_ target independent, WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152600



More information about the llvm-commits mailing list