[llvm] 238139b - [DSE][NFC] Clean up DeadStoreElimination from unused variables

Dawid Jurczak via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 10:49:53 PDT 2021


Author: Dawid Jurczak
Date: 2021-08-04T19:44:40+02:00
New Revision: 238139be095236ebcd4274b3de5a750262c969c3

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

LOG: [DSE][NFC] Clean up DeadStoreElimination from unused variables

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

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 0ada5c6e72c9..cd0824ab33b7 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1786,7 +1786,6 @@ struct DSEState {
         continue;
 
       Instruction *DefI = Def->getMemoryInst();
-      SmallVector<const Value *, 4> Pointers;
       auto DefLoc = getLocForWriteEx(DefI);
       if (!DefLoc)
         continue;
@@ -1814,8 +1813,7 @@ struct DSEState {
 
   /// \returns true if \p Def is a no-op store, either because it
   /// directly stores back a loaded value or stores zero to a calloced object.
-  bool storeIsNoop(MemoryDef *Def, const MemoryLocation &DefLoc,
-                   const Value *DefUO) {
+  bool storeIsNoop(MemoryDef *Def, const Value *DefUO) {
     StoreInst *Store = dyn_cast<StoreInst>(Def->getMemoryInst());
     MemSetInst *MemSet = dyn_cast<MemSetInst>(Def->getMemoryInst());
     Constant *StoredConstant = nullptr;
@@ -2084,7 +2082,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA,
 
     // Check if the store is a no-op.
     if (!Shortend && isRemovable(SI) &&
-        State.storeIsNoop(KillingDef, SILoc, SILocUnd)) {
+        State.storeIsNoop(KillingDef, SILocUnd)) {
       LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n  DEAD: " << *SI << '\n');
       State.deleteDeadInstruction(SI);
       NumRedundantStores++;


        


More information about the llvm-commits mailing list