[all-commits] [llvm/llvm-project] e1878d: [LoongArch] Add support for vector FP_ROUND from v...

Zhaoxin Yang via All-commits all-commits at lists.llvm.org
Thu Apr 16 20:40:33 PDT 2026


  Branch: refs/heads/users/ylzsx/opt-vector-fptrunc
  Home:   https://github.com/llvm/llvm-project
  Commit: e1878d7e999fa74ba043640874779a63e5ac7e49
      https://github.com/llvm/llvm-project/commit/e1878d7e999fa74ba043640874779a63e5ac7e49
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
    M llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
    M llvm/test/CodeGen/LoongArch/lasx/ir-instruction/fptrunc.ll
    M llvm/test/CodeGen/LoongArch/lsx/ir-instruction/fptrunc.ll

  Log Message:
  -----------
  [LoongArch] Add support for vector FP_ROUND from vxf64 to vxf32

In LoongArch, [x]vfcvt.s.d intstructions require two vector registers
for v4f64->v4f32, v8f64->v8f32 conversions.

This patch handles these cases:
- For FP_ROUND v2f64->v2f32(illegal), add a customized v2f32 widening
  to convert it into a target-specific LoongArchISD::VFCVT.
- For FP_ROUND v4f64->v4f32, on LSX platforms, v4f64 is illegal and will
  be split into two v2f64->v2f32, resulting in two LoongArchISD::VFCVT.
  Finally, they are combined into a single node during combining
  LoongArchISD::VPACKEV. On LASX platforms, v4f64->v4f32 can directly
  lower to vfcvt.s.d in lowerFP_ROUND.
- For FP_ROUND v8f64->v8f32, on LASX platforms, v8f64 is illegal and
  will be split into two v4f64->v4f32 and then combine using
  ISD::CONCAT_VECTORS, so xvfcvt.s.d is generated during its
  combination.


  Commit: 2acb741f626a31c8880fa85b7b5d587fafe0b1fb
      https://github.com/llvm/llvm-project/commit/2acb741f626a31c8880fa85b7b5d587fafe0b1fb
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/test/CodeGen/LoongArch/lasx/ir-instruction/fptrunc.ll
    M llvm/test/CodeGen/LoongArch/lsx/ir-instruction/fptrunc.ll

  Log Message:
  -----------
  fixes according reviews


  Commit: 2487d43445e8fa544f20128952abeda314b7c1a9
      https://github.com/llvm/llvm-project/commit/2487d43445e8fa544f20128952abeda314b7c1a9
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

  Log Message:
  -----------
  stricter restrictions on original types


Compare: https://github.com/llvm/llvm-project/compare/efaff2aa9eea...2487d43445e8

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