[PATCH] [SDAG] When performing post-legalize DAG combining, run the legalizer over each node in the worklist prior to combining.

hfinkel at anl.gov hfinkel at anl.gov
Fri Jul 25 17:12:52 PDT 2014


LGTM.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:185
@@ -171,1 +184,3 @@
+    for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i)
+      DAG.TransferDbgValues(SDValue(Old, i), SDValue(New, i));
     ReplacedNode(Old);
----------------
Is this a fly-by fix, or something that was not needed previously?

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4313
@@ +4312,3 @@
+
+// This is a somewhat hacky entry point to legalize a single sub-graph rooted
+// at a node. This is used by the post-legalize DAG combiner to allow its DAG
----------------
I actually dislike this comment because it calls something hacky without explaining why or what should be done instead.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4320
@@ +4319,3 @@
+  allnodes_iterator LegalizePosition(N);
+  SmallPtrSet<SDNode *, 16> LegalizedNodes;
+  SelectionDAGLegalize Legalizer(*this, LegalizePosition, LegalizedNodes,
----------------
If we could get a vector scalarization here, I'd make this 64 instead of 16.

http://reviews.llvm.org/D4564






More information about the llvm-commits mailing list