[PATCH] D156215: [DAGcombiner] Reassociate the operands from (OR (OR(CMP1, CMP2)), CMP3) to (OR (OR(CMP1, CMP3)), CMP2)
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 09:04:43 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1333-1336
+ if (Opc == ISD::AND || Opc == ISD::OR) {
+ if (N1->getOpcode() == ISD::SETCC && N00->getOpcode() == ISD::SETCC &&
+ N01->getOpcode() == ISD::SETCC) {
+ ISD::CondCode CC1 = cast<CondCodeSDNode>(N1.getOperand(2))->get();
----------------
Should add a dag comment explaining the transform
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1342
+ return DAG.getNode(Opc, DL, VT, OpNode, N01, Flags);
+ } else if (CC1 == CC01 && CC1 != CC00) {
+ SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N01, N1, Flags);
----------------
no else after return
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156215/new/
https://reviews.llvm.org/D156215
More information about the llvm-commits
mailing list