[llvm] [ConstantHoisting] Add a TTI hook to prevent hoisting. (PR #69004)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 05:33:54 PDT 2023


paulwalker-arm wrote:

> Does this need to be target-specific? Not hoisting divisors to allow efficient expansion seems like something all targets would benefit from.

I guess not given the decision is derived from an existing TLI hook.  I've moved the implementation into BaseTTI.

> This should probably be in getIntImmCostInst, similar to the Arm version:

I originally considered this but it felt wrong because the code generation doesn't necessary result in cheap or free constants.  For the cases I want to handle the resulting constants are just as expensive with the gain being the removal of the divides.


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


More information about the llvm-commits mailing list