]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Add an option to control whether or not to enable store merging.
authorWei Mi <wmi@google.com>
Tue, 30 Jul 2019 23:14:56 +0000 (23:14 +0000)
committerWei Mi <wmi@google.com>
Tue, 30 Jul 2019 23:14:56 +0000 (23:14 +0000)
Add an option to control whether or not to enable store merging in dag combiner
so we can workaround some bugs more easily.

Differential Revision: https://reviews.llvm.org/D65482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367365 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 835425021dcb30595b8914b9c929b036ac116591..bf62aa865098c644c44fab20a55b9f4a5f12a230 100644 (file)
@@ -111,6 +111,11 @@ static cl::opt<bool>
   MaySplitLoadIndex("combiner-split-load-index", cl::Hidden, cl::init(true),
                     cl::desc("DAG combiner may split indexing from loads"));
 
+static cl::opt<bool>
+    EnableStoreMerging("combiner-store-merging", cl::Hidden, cl::init(true),
+                       cl::desc("DAG combiner enable merging multiple stores "
+                                "into a wider store"));
+
 static cl::opt<unsigned> TokenFactorInlineLimit(
     "combiner-tokenfactor-inline-limit", cl::Hidden, cl::init(2048),
     cl::desc("Limit the number of operands to inline for Token Factors"));
@@ -15521,7 +15526,7 @@ bool DAGCombiner::checkMergeStoreCandidatesForDependencies(
 }
 
 bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
-  if (OptLevel == CodeGenOpt::None)
+  if (OptLevel == CodeGenOpt::None || !EnableStoreMerging)
     return false;
 
   EVT MemVT = St->getMemoryVT();