[llvm] c0d4b44 - [DAG] DAGCombiner::tryStoreMergeOfLoads - remove unused StartAddress variable. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 05:29:50 PST 2021


Author: Simon Pilgrim
Date: 2021-03-02T13:29:31Z
New Revision: c0d4b44e6a710fd648b68823860aa44e7f114c8e

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

LOG: [DAG] DAGCombiner::tryStoreMergeOfLoads - remove unused StartAddress variable. NFCI.

Noticed in "initialization is never read" clang-tidy warning - the only StartAddress set/used is inside the load combine loop.

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 cdac27c04d46..12cd83806802 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17281,8 +17281,6 @@ bool DAGCombiner::tryStoreMergeOfLoads(SmallVectorImpl<MemOpLink> &StoreNodes,
   unsigned NumMemElts = MemVT.isVector() ? MemVT.getVectorNumElements() : 1;
   bool MadeChange = false;
 
-  int64_t StartAddress = StoreNodes[0].OffsetFromBase;
-
   // Look for load nodes which are used by the stored values.
   SmallVector<MemOpLink, 8> LoadNodes;
 
@@ -17350,7 +17348,7 @@ bool DAGCombiner::tryStoreMergeOfLoads(SmallVectorImpl<MemOpLink> &StoreNodes,
     unsigned LastLegalIntegerType = 1;
     bool isDereferenceable = true;
     bool DoIntegerTruncate = false;
-    StartAddress = LoadNodes[0].OffsetFromBase;
+    int64_t StartAddress = LoadNodes[0].OffsetFromBase;
     SDValue LoadChain = FirstLoad->getChain();
     for (unsigned i = 1; i < LoadNodes.size(); ++i) {
       // All loads must share the same chain.


        


More information about the llvm-commits mailing list