[llvm] [AMDGPU] Legalized FMINIMUM/FMAXIMUM operations to remove redundant canonicalization (PR #208176)
Nikhil Kotikalapudi via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 8 23:12:12 PDT 2026
nkotikal wrote:
> This does not look right to me. But there indeed seem to be cases of "redundant canonicalization". Perhaps this can be improved in the canonicalization combines?
Pasting my summary I sent earlier here as well for the benefit of others reading -
FMINNUM_IEEE opcode maps to v_min_f32_e32, and FMINNUM opcode maps to canonicalize + FMINNUM_IEEE, as evidenced by the --debug-only=isel output. So since we know that FMINNUM_IEEE correctly handles sNaNs and it directly maps to v_min_f32_e32, then it is trivial to state that FMINNUM can directly map to v_min_f32_e32 as well without the requirement for canonicalization. The code creating the extra ops for FMINNUM believes that v_min_f32_e32 cannot properly handle sNaN, but FMINNUM_IEEE mapping to that instruction proves it can.
The key is that FMINNUM and FMINNUM_IEEE share the same semantics now and FMINNUM_IEEE is depracated.
https://github.com/llvm/llvm-project/pull/208176
More information about the llvm-commits
mailing list