[all-commits] [llvm/llvm-project] 548fa1: [RISCV] Add special case for (select cc, 1.0, 0.0)...

Liao Chunyu via All-commits all-commits at lists.llvm.org
Wed May 31 00:21:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 548fa1d3086f5fe6e6e1bf52bb661e00a954503e
      https://github.com/llvm/llvm-project/commit/548fa1d3086f5fe6e6e1bf52bb661e00a954503e
  Author: LiaoChunyu <chunyu at iscas.ac.cn>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/double-select-icmp.ll
    M llvm/test/CodeGen/RISCV/float-select-icmp.ll
    M llvm/test/CodeGen/RISCV/half-select-icmp.ll

  Log Message:
  -----------
  [RISCV] Add special case for (select cc, 1.0, 0.0) to lowerSELECT

Use sint_to_fp instead of select.
Reduce the number of branch instructions and
avoid generating TargetConstantPool for double.

(select cc, 1.0, 0.0) -> (sint_to_fp (zext cc))
https://alive2.llvm.org/ce/z/aoEcd9
https://godbolt.org/z/n543Y9v3e

(select cc, 0.0, 1.0) -> (sint_to_fp (zext (xor cc, 1)))
https://alive2.llvm.org/ce/z/zngvSB

Reviewed By: craig.topper

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




More information about the All-commits mailing list