summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c23469e166b..a98d151b443 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1792,8 +1792,9 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
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.
OpenPOWER on IntegriCloud