[llvm] [RISCV] Teach RISCVTargetLowering::isFPImmLegal about fli+fneg (PR #149075)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 21 10:19:22 PDT 2025
https://github.com/topperc approved this pull request.
LGTM. I think I'm ok with this. But I want to note that this only works because LowerConstantFP creates a RISCVISD::FLI node. Which it does because visitFNEG will always converts ConstantFP+fneg into a ConstantFP of the negated value without checking isFPImmLegal.
If we were to ever make visitFNEG obey isFPImmLegal and change LowerConstantFP to emit ConstantFP+FNEG instead of FLI+FNEG, we would infinite loop.
https://github.com/llvm/llvm-project/pull/149075
More information about the llvm-commits
mailing list