[llvm] 63854f9 - [DAGCombiner] fix comments for D138899; NFC

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 21:32:48 PST 2023


Author: Chen Zheng
Date: 2023-02-07T00:32:34-05:00
New Revision: 63854f91d3ee1056796a5ef27753648396cac6ec

URL: https://github.com/llvm/llvm-project/commit/63854f91d3ee1056796a5ef27753648396cac6ec
DIFF: https://github.com/llvm/llvm-project/commit/63854f91d3ee1056796a5ef27753648396cac6ec.diff

LOG: [DAGCombiner] fix comments for D138899; NFC

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 112d7299f5774..dbbbcd1da9a4e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -362,6 +362,10 @@ namespace {
     SDValue SplitIndexingFromLoad(LoadSDNode *LD);
     bool SliceUpLoad(SDNode *N);
 
+    // Looks up the chain to find a unique (unaliased) store feeding the passed
+    // load. If no such store is found, returns a nullptr.
+    // Note: This will look past a CALLSEQ_START if the load is chained to it so
+    //       so that it can find stack stores for byval params.
     StoreSDNode *getUniqueStoreFeeding(LoadSDNode *LD, int64_t &Offset);
     // Scalars have size 0 to distinguish from singleton vectors.
     SDValue ForwardStoreValueToDirectLoad(LoadSDNode *LD);
@@ -17460,14 +17464,14 @@ StoreSDNode *DAGCombiner::getUniqueStoreFeeding(LoadSDNode *LD,
         continue;
       BaseIndexOffset BasePtrLD = BaseIndexOffset::match(LD, DAG);
       BaseIndexOffset BasePtrST = BaseIndexOffset::match(Store, DAG);
-      if (BasePtrST.equalBaseIndex(BasePtrLD, DAG, Offset)) {
-        // Make sure the store is not aliased with any nodes in TokenFactor.
-        GatherAllAliases(Store, Chain, Aliases);
-        if (Aliases.empty() ||
-            (Aliases.size() == 1 && Aliases.front().getNode() == Store))
-          ST = Store;
-        break;
-      }
+      if (!BasePtrST.equalBaseIndex(BasePtrLD, DAG, Offset))
+        continue;
+      // Make sure the store is not aliased with any nodes in TokenFactor.
+      GatherAllAliases(Store, Chain, Aliases);
+      if (Aliases.empty() ||
+          (Aliases.size() == 1 && Aliases.front().getNode() == Store))
+        ST = Store;
+      break;
     }
   } else {
     StoreSDNode *Store = dyn_cast<StoreSDNode>(Chain.getNode());


        


More information about the llvm-commits mailing list