[llvm-branch-commits] Transforms: Have CSE/GVN/LICM check isProfitableToHoist() before hoisting. (PR #141325)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri May 23 20:15:02 PDT 2025
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141325
LICM hoists instructions into the preheader, and CSE and GVN
can effectively perform a hoist by replacing an instruction with
one from another basic block, all of which can lead to the same
kinds of pessimizations that isProfitableToHoist() is intended to
prevent. Therefore, call the hook from all these passes.
This will be tested in the subsequent change that adds a previously
hoistable case and verifies that no optimization pass hoists it.
More information about the llvm-branch-commits
mailing list