[PATCH] D151719: [RISCV] Add special case for (select cc, 1.0, 0.0) to lowerSELECT

Liao Chunyu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 20:17:49 PDT 2023


liaolucy updated this revision to Diff 526876.
liaolucy marked 2 inline comments as done.
liaolucy retitled this revision from "[RISCV] Add special case for (select_cc 0, x, setlt, 0.0, 1.0) to lowerSELECT" to "[RISCV] Add special case for (select cc, 1.0, 0.0) to lowerSELECT".
liaolucy edited the summary of this revision.
liaolucy added a comment.

If the select true/false are 1.0 and 0.0 we can replace the select with a sint_to_fp. 
(select cc, 1.0, 0.0) -> (sint_to_fp (zext cc))
https://alive2.llvm.org/ce/z/aoEcd9
thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151719/new/

https://reviews.llvm.org/D151719

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151719.526876.patch
Type: text/x-patch
Size: 7686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230531/a97907c4/attachment.bin>


More information about the llvm-commits mailing list