Skip to content

Commit

Permalink
[DSE] Remove unnecessary check in getLocForWrite() (NFC)
Browse files Browse the repository at this point in the history
MemoryLocation::getForDest() checks this itself, call it directly.
  • Loading branch information
nikic committed Dec 24, 2021
1 parent 72d2201 commit 90095a0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Expand Up @@ -988,14 +988,8 @@ struct DSEState {
if (!I->mayWriteToMemory())
return None;

if (auto *CB = dyn_cast<CallBase>(I)) {
// If the functions may write to memory we do not know about, bail out.
if (!CB->onlyAccessesArgMemory() &&
!CB->onlyAccessesInaccessibleMemOrArgMem())
return None;

if (auto *CB = dyn_cast<CallBase>(I))
return MemoryLocation::getForDest(CB, TLI);
}

return MemoryLocation::getOrNone(I);
}
Expand Down

0 comments on commit 90095a0

Please sign in to comment.