[all-commits] [llvm/llvm-project] 201f64: [LegalizeTypes][X86] Improve ExpandIntRes_FP_TO_SI...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Aug 30 13:13:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 201f6446da5643fb13cbbbe58c58311a70a9bd43
      https://github.com/llvm/llvm-project/commit/201f6446da5643fb13cbbbe58c58311a70a9bd43
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-08-30 (Mon, 30 Aug 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/test/CodeGen/X86/half.ll

  Log Message:
  -----------
  [LegalizeTypes][X86] Improve ExpandIntRes_FP_TO_SINT/ExpandIntRes_FP_TO_UINT when input is SoftPromoteHalf.

Instead of splitting off the fp16 to float conversion and generating
a libcall, we should split the operation into fp16 to float and float
to integer operations. This will allow the float to integer conversion
to go through any custom handling the target has. If the target doesn't
have custom handling then we should come back to ExpandIntRes_FP_TO_SINT/
ExpandIntRes_FP_TO_UINT automatically to create the libcall.

This avoids generating libcalls on 32-bit X86. These library functions may
not exist in 32-bit libgcc. At least for LLVM, we never generate them when
hardware floating point instructions are available.

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




More information about the All-commits mailing list