[llvm] r321204 - [DAG] Fix condition on overlapping store check.

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 11:06:47 PST 2017


Author: niravd
Date: Wed Dec 20 11:06:47 2017
New Revision: 321204

URL: http://llvm.org/viewvc/llvm-project?rev=321204&view=rev
Log:
[DAG] Fix condition on overlapping store check.

Prevent overlapping store elision when overlapping store is
pre-inc/dec as analysis is wrong in these cases.

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=321204&r1=321203&r2=321204&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Dec 20 11:06:47 2017
@@ -13786,8 +13786,8 @@ SDValue DAGCombiner::visitSTORE(SDNode *
 
   // Deal with elidable overlapping chained stores.
   if (StoreSDNode *ST1 = dyn_cast<StoreSDNode>(Chain))
-    if (OptLevel != CodeGenOpt::None && ST1->isUnindexed() &&
-        !ST1->isVolatile() && ST1->hasOneUse() &&
+    if (OptLevel != CodeGenOpt::None && ST->isUnindexed() &&
+        ST1->isUnindexed() && !ST1->isVolatile() && ST1->hasOneUse() &&
         !ST1->getBasePtr().isUndef() && !ST->isVolatile()) {
       BaseIndexOffset STBasePtr = BaseIndexOffset::match(ST->getBasePtr(), DAG);
       BaseIndexOffset ST1BasePtr =




More information about the llvm-commits mailing list