llvm-project
b0ed1920 - [AMDGPU] Lower -1.0 / x as fneg (rcp x) (#243129)

Commit
5 hours ago
[AMDGPU] Lower -1.0 / x as fneg (rcp x) (#243129) Lowering -1.0 / x to rcp (fneg x) pins the fneg to x's producer. After DAGCombiner turns fma(1.0 / x, fneg y, z) into fma(-1.0 / x, y, z) (see #199909), the fneg lands on e.g. a v_mul_f32 and forces VOP3 (+4 bytes) instead of being a free modifier on the fma. Lower it to fneg (rcp x) and let the existing fneg combines place it. Do the same in GlobalISel, where it also lets -1.0 / sqrt(x) form rsq. Fixes #187482.
Author
Parents
Loading