[llvm] [MemoryLocation] Compute lifetime size from alloca size (PR #151982)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 4 08:48:00 PDT 2025
================
@@ -190,7 +190,21 @@ MemoryLocation MemoryLocation::getForArgument(const CallBase *Call,
return MemoryLocation::getAfter(Arg, AATags);
case Intrinsic::lifetime_start:
- case Intrinsic::lifetime_end:
+ case Intrinsic::lifetime_end: {
+ assert(ArgIdx == 1 && "Invalid argument index");
+ auto *AI = dyn_cast<AllocaInst>(Arg);
+ if (!AI)
+ // lifetime of poison value.
+ return MemoryLocation::getBeforeOrAfter(Arg);
----------------
nikic wrote:
The verifier checks it (see https://github.com/llvm/llvm-project/pull/151148).
https://github.com/llvm/llvm-project/pull/151982
More information about the llvm-commits
mailing list