[PATCH] D153502: [DAGCombiner] Change foldAndOrOfSETCC() to optimize and/or patterns

Konstantina Mitropoulou via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 22:14:48 PDT 2023


kmitropoulou marked an inline comment as done.
kmitropoulou added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6087
+    ISD::CondCode CC = CCL;
+    if (LHS0 == RHS0) {
+      CommonValue = LHS0;
----------------
foad wrote:
> AreSameCMPsAndHaveCommonOperand already checks the various different cases of CCL==CCR etc and LHS0==RHS0 etc, and now you have to check them again here. To avoid the duplication why not just inline AreSameCMPsAndHaveCommonOperand here? You could set `CC=SETCC_INVALID` at the start, then go through the cases, then test `CC==SETCC_INVALID` to see if any of them matched.
I am sorry I missed this comment. I addressed it in the latest patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153502



More information about the llvm-commits mailing list