diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-10-18 18:06:48 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-10-18 18:06:48 +0000 |
commit | 1c5bf3f429927c31b9ffc1308ea1ada7a58ee1c0 (patch) | |
tree | 77ea17ecec57bf22165c5696e581d0bb7eee2feb /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | bef36ac2a47dd647af332b8594031df6fe2522c5 (diff) |
In SimplifySelectOps we pulled two loads through a select node despite the fact that one was dependent on the other.
rdar://12513091
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f2d3a8d4fe..22270968e3 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9075,6 +9075,10 @@ bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS, if ((LLD->hasAnyUseOfValue(1) && LLD->isPredecessorOf(CondNode)) || (RLD->hasAnyUseOfValue(1) && RLD->isPredecessorOf(CondNode))) return false; + // The loads must not depend on one another. + if (LLD->isPredecessorOf(RLD) || + RLD->isPredecessorOf(LLD)) + return false; Addr = DAG.getNode(ISD::SELECT, TheSelect->getDebugLoc(), LLD->getBasePtr().getValueType(), TheSelect->getOperand(0), LLD->getBasePtr(), |