[all-commits] [llvm/llvm-project] 8c0551: [LegalizeIntegerTypes] Simplify ExpandIntRes_FP_TO...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Sep 12 08:28:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c0551503219b8e1da7dd6c24de1d9e79cb7cae6
      https://github.com/llvm/llvm-project/commit/8c0551503219b8e1da7dd6c24de1d9e79cb7cae6
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2024-09-12 (Thu, 12 Sep 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/test/CodeGen/RISCV/half-convert.ll

  Log Message:
  -----------
  [LegalizeIntegerTypes] Simplify ExpandIntRes_FP_TO_XINT when operand needs to be SoftPromoted. (#107634)

Create an FP_EXTEND instead of handling the soft promote directly. This
FP_EXTEND will be visited and soft promoted itself.

This removes a zero extend from the generated code when the f32 type is
itself softened. Previously we softened it as an fp16_to_fp which sees
the operand as an integer type so we extend it. When we soften the
result as an fp_extend we see the source as f16 and don't extend. It
only becomes an integer inside call lowering not by type legalization.

If this extend is really necessary, then we have an issue when an
f16->f32 fp_extend exists in the source and f32 needs to be softened.

This simplifies part of #102503.



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