summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2019-03-29 18:50:22 +0000
committerNirav Dave <niravd@google.com>2019-03-29 18:50:22 +0000
commit7e84cacdbd599b78d313793d36c1ce484b8cbd14 (patch)
tree3ff154b16acd51b811fd13ba771aaac8edeb1447 /llvm/lib/CodeGen
parent9e911f3a6476e92f633436045528b1ac2e7d4161 (diff)
downloadbcm5719-llvm-7e84cacdbd599b78d313793d36c1ce484b8cbd14.tar.gz
bcm5719-llvm-7e84cacdbd599b78d313793d36c1ce484b8cbd14.zip
[DAG] Avoid redundancy in StoreMerge TokenFactor generation.
Avoid generating redundant TokenFactor when all merged stores have the same chain. llvm-svn: 357299
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2cd698eb7e0..13e1e96cc92 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14514,9 +14514,9 @@ SDValue DAGCombiner::getMergeStoreChains(SmallVectorImpl<MemOpLink> &StoreNodes,
Visited.insert(StoreNodes[i].MemNode);
}
- // don't include nodes that are children
+ // don't include nodes that are children or repeated nodes.
for (unsigned i = 0; i < NumStores; ++i) {
- if (Visited.count(StoreNodes[i].MemNode->getChain().getNode()) == 0)
+ if (Visited.insert(StoreNodes[i].MemNode->getChain().getNode()).second)
Chains.push_back(StoreNodes[i].MemNode->getChain());
}
OpenPOWER on IntegriCloud