summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-04-26 21:48:25 +0000
committerAndrew Trick <atrick@apple.com>2012-04-26 21:48:25 +0000
commit03fa574af5115c10ac896a5cb2334a3a157495fd (patch)
tree1f01f32e21114c551299a802df058292570d2d23 /llvm/lib
parentc6a0a6c52dd016c0654073389ee89a3a4fef8c02 (diff)
downloadbcm5719-llvm-03fa574af5115c10ac896a5cb2334a3a157495fd.tar.gz
bcm5719-llvm-03fa574af5115c10ac896a5cb2334a3a157495fd.zip
Fix the SD scheduler to avoid gluing the same node twice.
DAGCombine strangeness may result in multiple loads from the same offset. They both may try to glue themselves to another load. We could insist that the redundant loads glue themselves to each other, but the beter fix is to bail out from bad gluing at the time we detect it. Fixes rdar://11314175: BuildSchedUnits assert. llvm-svn: 155668
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 69dd813b24e..8ec1ae8620f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -138,9 +138,11 @@ static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) {
// Don't add glue from a node to itself.
if (GlueDestNode == N) return;
- // Don't add glue to something which already has glue.
- if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return;
-
+ // Don't add glue to something that already has it, either as a use or value.
+ if (N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue ||
+ N->getValueType(N->getNumValues() - 1) == MVT::Glue) {
+ return;
+ }
for (unsigned I = 0, E = N->getNumValues(); I != E; ++I)
VTs.push_back(N->getValueType(I));
OpenPOWER on IntegriCloud