summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-05 06:19:13 +0000
committerChris Lattner <sabre@nondot.org>2010-03-05 06:19:13 +0000
commit55e81eb49fb3779ea658d05d5c84e08da3f42136 (patch)
tree37592ed9a5cab7284ceced1801382f50fbf4c290 /llvm/lib/CodeGen
parentbfdd17a2ea3778fe3f420bda25121572aea47f78 (diff)
downloadbcm5719-llvm-55e81eb49fb3779ea658d05d5c84e08da3f42136.tar.gz
bcm5719-llvm-55e81eb49fb3779ea658d05d5c84e08da3f42136.zip
Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag. That flag in turn was used by an already-selected adde which turned into an ADC32ri8 which used a selected load which was chained to the load we folded. This flag use caused us to form a cycle. Fix this by not ignoring chains in IsLegalToFold even in cases where the isel thinks it can. llvm-svn: 97791
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index b9ec4c46f3b..f426fb1f3fa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1485,7 +1485,14 @@ bool SelectionDAGISel::IsLegalToFold(SDValue N, SDNode *U, SDNode *Root,
break;
Root = FU;
VT = Root->getValueType(Root->getNumValues()-1);
+
+ // If our query node has a flag result with a use, we've walked up it. If
+ // the user (which has already been selected) has a chain or indirectly uses
+ // the chain, our WalkChainUsers predicate will not consider it. Because of
+ // this, we cannot ignore chains in this predicate.
+ IgnoreChains = false;
}
+
SmallPtrSet<SDNode*, 16> Visited;
return !findNonImmUse(Root, N.getNode(), U, Root, Visited, IgnoreChains);
OpenPOWER on IntegriCloud