[llvm] [InstCombine] Fold dependent IVs (PR #81151)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 07:51:02 PST 2024
nikic wrote:
> Do you have any performance data to show that this change is a benefit to backends? Backends seem to prefer the original form. Godbolt: https://godbolt.org/z/4z1jWvY5v
This depends on the backend, and LSR will convert it into the preferred form. For targets with weak addressing modes like RISCV, LSR will prefer the old form, for targets with strong addressing modes like X86 or ARM it will prefer the new.
In that sense, it shouldn't really matter for the backend which form we chose, as it will be rewritten anyway, so the primary consideration would be about the middle end.
The context for this PR is https://github.com/llvm/llvm-project/pull/81614, where I encountered this pattern and thought it is a regression. I don't have a motivation for it beyond that.
https://github.com/llvm/llvm-project/pull/81151
More information about the llvm-commits
mailing list