Skip to content

Commit 74001be

Browse files
committed
[DSE] Use MemoryLocation API to get lifetime.end size (NFC)
1 parent 910f6ad commit 74001be

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,13 +1360,10 @@ struct DSEState {
13601360
/// indicating whether \p I is a free-like call.
13611361
std::optional<std::pair<MemoryLocation, bool>>
13621362
getLocForTerminator(Instruction *I) const {
1363-
uint64_t Len;
1364-
Value *Ptr;
1365-
if (match(I, m_Intrinsic<Intrinsic::lifetime_end>(m_ConstantInt(Len),
1366-
m_Value(Ptr))))
1367-
return {std::make_pair(MemoryLocation(Ptr, Len), false)};
1368-
13691363
if (auto *CB = dyn_cast<CallBase>(I)) {
1364+
if (CB->getIntrinsicID() == Intrinsic::lifetime_end)
1365+
return {
1366+
std::make_pair(MemoryLocation::getForArgument(CB, 1, &TLI), false)};
13701367
if (Value *FreedOp = getFreedOperand(CB, &TLI))
13711368
return {std::make_pair(MemoryLocation::getAfter(FreedOp), true)};
13721369
}

0 commit comments

Comments
 (0)