[llvm] [DeadStoreElimination] Refactor out `pushMemUses`; drop dead check (NFC) (PR #98530)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 12:58:45 PDT 2024


================
@@ -1162,21 +1172,11 @@ struct DSEState {
                       << *Def->getMemoryInst()
                       << ") is at the end the function \n");
 
-    auto MaybeLoc = getLocForWrite(Def->getMemoryInst());
-    if (!MaybeLoc) {
-      LLVM_DEBUG(dbgs() << "  ... could not get location for write.\n");
-      return false;
-    }
-
+    MemoryLocation DefLoc = *getLocForWrite(Def->getMemoryInst());
----------------
antoniofrighetto wrote:

We still want to push the memory access in the worklist though, so we would be still passing the MemoryDef, right? Felt a bit cleaner to pass only one the MemoryDef.

https://github.com/llvm/llvm-project/pull/98530


More information about the llvm-commits mailing list