[llvm] r332489 - [DAG] Defer merge store cycle checking to just before merge. NFCI.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Wed May 16 09:47:54 PDT 2018
Author: niravd
Date: Wed May 16 09:47:54 2018
New Revision: 332489
URL: http://llvm.org/viewvc/llvm-project?rev=332489&view=rev
Log:
[DAG] Defer merge store cycle checking to just before merge. NFCI.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=332489&r1=332488&r2=332489&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed May 16 09:47:54 2018
@@ -13473,14 +13473,6 @@ bool DAGCombiner::MergeConsecutiveStores
continue;
}
- // Check that we can merge these candidates without causing a cycle
- if (!checkMergeStoreCandidatesForDependencies(StoreNodes,
- NumConsecutiveStores)) {
- StoreNodes.erase(StoreNodes.begin(),
- StoreNodes.begin() + NumConsecutiveStores);
- continue;
- }
-
// The node with the lowest store address.
LLVMContext &Context = *DAG.getContext();
const DataLayout &DL = DAG.getDataLayout();
@@ -13576,6 +13568,12 @@ bool DAGCombiner::MergeConsecutiveStores
continue;
}
+ // Check that we can merge these candidates without causing a cycle.
+ if (!checkMergeStoreCandidatesForDependencies(StoreNodes, NumElem)) {
+ StoreNodes.erase(StoreNodes.begin(), StoreNodes.begin() + NumElem);
+ continue;
+ }
+
bool Merged = MergeStoresOfConstantsOrVecElts(
StoreNodes, MemVT, NumElem, true, UseVector, LastIntegerTrunc);
RV |= Merged;
@@ -13634,6 +13632,14 @@ bool DAGCombiner::MergeConsecutiveStores
continue;
}
+ // Check that we can merge these candidates without causing a cycle.
+ if (!checkMergeStoreCandidatesForDependencies(StoreNodes,
+ NumStoresToMerge)) {
+ StoreNodes.erase(StoreNodes.begin(),
+ StoreNodes.begin() + NumStoresToMerge);
+ continue;
+ }
+
bool Merged = MergeStoresOfConstantsOrVecElts(
StoreNodes, MemVT, NumStoresToMerge, false, true, false);
if (!Merged) {
@@ -13803,6 +13809,12 @@ bool DAGCombiner::MergeConsecutiveStores
continue;
}
+ // Check that we can merge these candidates without causing a cycle.
+ if (!checkMergeStoreCandidatesForDependencies(StoreNodes, NumElem)) {
+ StoreNodes.erase(StoreNodes.begin(), StoreNodes.begin() + NumElem);
+ continue;
+ }
+
// Find if it is better to use vectors or integers to load and store
// to memory.
EVT JointMemOpVT;
More information about the llvm-commits
mailing list