[PATCH] D61397: [DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 07:57:17 PDT 2019


fhahn updated this revision to Diff 198004.
fhahn retitled this revision from "[DAGCombiner] Limit number of nodes to explore, to avoid quadratic compile time." to "[DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor".
fhahn edited the summary of this revision.
fhahn added a comment.

Limit this patch to visitTokenFactor, limiting the number of operands to inline to 2048 nodes.


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

https://reviews.llvm.org/D61397

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1792,8 +1792,9 @@
   TFs.push_back(N);
 
   // Iterate through token factors.  The TFs grows when new token factors are
-  // encountered.
-  for (unsigned i = 0; i < TFs.size(); ++i) {
+  // encountered. Limit number of nodes to inline, to avoid quadratic compile
+  // times.
+  for (unsigned i = 0; i < TFs.size() && Ops.size() <= 2048; ++i) {
     SDNode *TF = TFs[i];
 
     // Check each of the operands.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61397.198004.patch
Type: text/x-patch
Size: 636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190503/5f86b5ff/attachment.bin>


More information about the llvm-commits mailing list