[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 12:52:42 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:
I would feel more comfortable if you passed in this MemoryLocation already computed in the caller instead. That makes it clearer that this really cannot fail.
https://github.com/llvm/llvm-project/pull/98530
More information about the llvm-commits
mailing list