[llvm-branch-commits] Transforms: Have CSE/GVN/LICM check isProfitableToHoist() before hoisting. (PR #141325)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 23 23:40:52 PDT 2025


https://github.com/nikic requested changes to this pull request.

If you're using stacked pull requests, please link the other PRs from the stack. It's impossible to understand the context otherwise. Based on just the changes in this PR:

 * The EarlyCSE and GVN changes do not make sense to me. Those are very much not hoisting transforms, and profitability for hoisting an instruction and removing an instructions through CSE are not at all the same.
 * LICM is designed as a target-independent canonicalization pass, which explicitly does *not* use TTI for cost modelling. There are extensive previous discussions on this topic. From a quick search https://discourse.llvm.org/t/licm-as-canonical-form/59394 has a decent summary.

https://github.com/llvm/llvm-project/pull/141325


More information about the llvm-branch-commits mailing list