[all-commits] [llvm/llvm-project] ce5f4f: [RISCV] Use the 'si' lib call for (double (fp_to_s...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Nov 5 10:47:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ce5f4f22e9eff7edf4cbd22f69bebe8cc58251fd
      https://github.com/llvm/llvm-project/commit/ce5f4f22e9eff7edf4cbd22f69bebe8cc58251fd
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2020-11-05 (Thu, 05 Nov 2020)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rv64i-double-softfloat.ll

  Log Message:
  -----------
  [RISCV] Use the 'si' lib call for (double (fp_to_sint/uint i32 X)) when F extension is enabled.

D80526 added custom lowering to pick the si lib call on RV64, but this custom handling is only enabled when the F and D extension are both disabled. This prevents the si library call from being used for double when F is enabled but D is not.

This patch changes the behavior so we always enable the Custom hook on RV64 and decide in ReplaceNodeResults if we should emit a libcall based on whether the FP type should be softened or not.

Differential Revision: https://reviews.llvm.org/D90817




More information about the All-commits mailing list