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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 13:03:04 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());
----------------
nikic wrote:

Yes, you should pass both the MemoryDef and MemoryLocation.

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


More information about the llvm-commits mailing list