[PATCH] D61199: [DAG] Refactor DAGCombiner::ReassociateOps
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 10:08:02 PDT 2019
bjope added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1022
+ if (SDValue OpNode = DAG.FoldConstantArithmetic(Opc, DL, VT, C1, C2))
+ return DAG.getNode(Opc, DL, VT, N0.getOperand(0), OpNode);
+ return SDValue();
----------------
An alternative to avoid churn in test cases is to provide some bool indicating that we are handling the commuted scenario, and then swap the operand order here (and also on line 1028). I think that would result in the same operand ordering as in the past (but since the opcodes handled here are commutative it shouldn't matter for correctness).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61199/new/
https://reviews.llvm.org/D61199
More information about the llvm-commits
mailing list