summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-09-28 08:02:14 +0000
committerHal Finkel <hfinkel@anl.gov>2015-09-28 08:02:14 +0000
commitbd582581b8063f18969aeeec7c6447b7528fe2e6 (patch)
tree50f262163a3cc6fd36d7c4b91f5a66bbada9dfa4 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentf223cdf17eb004539f5243b76949c695cf887fb3 (diff)
downloadbcm5719-llvm-bd582581b8063f18969aeeec7c6447b7528fe2e6.tar.gz
bcm5719-llvm-bd582581b8063f18969aeeec7c6447b7528fe2e6.zip
[DAGCombine] Fix getStoreMergeAndAliasCandidates's AA-enabled chain walking
When AA is being used, non-aliasing stores are canonicalized to use the same chain, and DAGCombiner::getStoreMergeAndAliasCandidates can take advantage of this by looking only as users of a store's chain operand. However, user iteration is not result-number specific, we need to check that the use is as a chain operand, and not via some other operand. It is certainly possible to have another potentially-aliasing store, which shares the first's base pointer, and uses the first's chain's node via some other operand. Failure to catch this situation caused, at least in the included test case, an assert later because the relative sequence-number ordering caused later replacement to create a cycle in the DAG. llvm-svn: 248698
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index f94f506156c..ec64210667e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -10986,6 +10986,8 @@ void DAGCombiner::getStoreMergeAndAliasCandidates(
SDValue Chain = St->getChain();
for (auto I = Chain->use_begin(), E = Chain->use_end(); I != E; ++I) {
if (StoreSDNode *OtherST = dyn_cast<StoreSDNode>(*I)) {
+ if (I.getOperandNo() != 0)
+ continue;
if (OtherST->isVolatile() || OtherST->isIndexed())
continue;
OpenPOWER on IntegriCloud