[llvm] [InstCombine] Transform high latency, dependent FSQRT/FDIV into FMUL (PR #87474)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 11:32:11 PDT 2024


arsenm wrote:

> I am wondering if instcombine is the right place to reason about this? At this point, we don't have any info on the cost of instructions. 

I think it's entirely reasonable to assume fmul is universally cheaper than fdiv. Plus the infrastructure for doing anything in the backend is significantly worse 

> This seems like it would be better placed in the backend, e.g. as a pattern MachineCombiner uses (which already tries to reassociate expressions, if it improves the critical path or other metrics)

This sounds unworkable for any target with nontrivial fdiv expansions

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


More information about the llvm-commits mailing list