[PATCH] D151719: [RISCV] Add special case for (select_cc 0, x, setlt, 0.0, 1.0) to lowerSELECT

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 14:22:23 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5565
 
+  // (select_cc 0, x, setge, 1.0, 0.0)
+  // -> (sint_to_fp (zext (setcc x, 1, setlt)))
----------------
craig.topper wrote:
> Why does the condition code matter? Isn't this equally valid for any condition code?
Or rather, why do the operands to the setcc matter? If you the select true/false are 1.0 and 0.0 you can replace the select with a sint_to_fp regardless of what the condition is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151719



More information about the llvm-commits mailing list