[all-commits] [llvm/llvm-project] 33df88: [RISCV] Teach RISCVTargetLowering::isFPImmLegal ab...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Tue Jul 22 06:22:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33df8882172dc3eb06db9846250de03dd3f7fff3
      https://github.com/llvm/llvm-project/commit/33df8882172dc3eb06db9846250de03dd3f7fff3
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2025-07-22 (Tue, 22 Jul 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp

  Log Message:
  -----------
  [RISCV] Teach RISCVTargetLowering::isFPImmLegal about fli+fneg (#149075)

There was a mismatch between isFPImmlegal and the cases that are handled
by lowerConstantFP. isFPImmLegal didn't check for the case where we
support `fli` of a negated constant (and so can lower to fli+fneg). This
has very minimal impact (42 insertion, 47 deletions across an
rv22u64_zfa llvm-test-suite build including SPEC CPU 2017) but is added
here for completeness.

See the PR thread https://github.com/llvm/llvm-project/pull/149075 for furrther discussion about the degree to which isFPImmLegal and lowerConstantFP are consistent. We ultimately agreed it makes sense to add fli+fneg, but there may be other future cases where it doesn't make sense to match.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list