[PATCH] D131471: [RISCV] Fold (sub constant, (setcc x, y, eq/neq)) -> (add constant - 1, (setcc x, y, neq/eq))

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 09:50:21 PDT 2022


craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.

LGTM with that change.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8284
+          DAG.getCondCode(ISD::getSetCCInverse(CCVal, N0.getValueType()));
+      SDValue NewN0 = DAG.getNode(ISD::SETCC, SDLoc(N), VT, N1->getOperand(0),
+                                  N1->getOperand(1), CCInverse);
----------------
Use `DAG.getSetCC` then you don't need to call getCondCode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131471



More information about the llvm-commits mailing list