summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-05-11 18:24:26 +0000
committerdim <dim@FreeBSD.org>2014-05-11 18:24:26 +0000
commit87ba4fbed530c9d0dff7505d121035f5ed09c9f3 (patch)
tree9f9245264c66971905eab3af40b7fc82e38fc2ad /lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
parentbbe9ac81c3fe3a3ea47d81758276b4432d28786a (diff)
downloadFreeBSD-src-87ba4fbed530c9d0dff7505d121035f5ed09c9f3.zip
FreeBSD-src-87ba4fbed530c9d0dff7505d121035f5ed09c9f3.tar.gz
Vendor import of llvm RELEASE_34/dot1-final tag r208032 (effectively, 3.4.1 release):
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/dot1-final@208032
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 054e3dd..c1893c9 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -219,8 +219,11 @@ void ScheduleDAGSDNodes::ClusterNeighboringLoads(SDNode *Node) {
DenseMap<long long, SDNode*> O2SMap; // Map from offset to SDNode.
bool Cluster = false;
SDNode *Base = Node;
+ // This algorithm requires a reasonably low use count before finding a match
+ // to avoid uselessly blowing up compile time in large blocks.
+ unsigned UseCount = 0;
for (SDNode::use_iterator I = Chain->use_begin(), E = Chain->use_end();
- I != E; ++I) {
+ I != E && UseCount < 100; ++I, ++UseCount) {
SDNode *User = *I;
if (User == Node || !Visited.insert(User))
continue;
@@ -237,6 +240,8 @@ void ScheduleDAGSDNodes::ClusterNeighboringLoads(SDNode *Node) {
if (Offset2 < Offset1)
Base = User;
Cluster = true;
+ // Reset UseCount to allow more matches.
+ UseCount = 0;
}
if (!Cluster)
OpenPOWER on IntegriCloud