[PATCH] D36581: [DAG] Fix Node Replacement in PromoteIntBinOp
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 23 11:57:55 PDT 2017
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1180
+ // predecessor first.
+ if (Replace0 && Replace1 && N0.getNode()->isPredecessorOf(N1.getNode())) {
+ std::swap(N0, N1);
----------------
Calling isPredecessorOf is a little risky; it's usually cheap, but the cost blows up for large DAGs. Hopefully this doesn't cause problems in practice.
https://reviews.llvm.org/D36581
More information about the llvm-commits
mailing list