[PATCH] D135600: [RISCV] Use branchless form for selects with 0 in either arm

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 09:55:30 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:9505
+    // (select c, y, 0) -> -c & y
+    if (isAllOnesConstant(FalseV)) {
+      SDValue C = DAG.getSetCC(DL, VT, LHS, RHS, CCVal);
----------------
Too much copy/paste. :) This should be `isNullConstant`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135600



More information about the llvm-commits mailing list