[PATCH] D84630: [StackSafety] Skip ambiguous lifetime analysis

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 14:25:17 PDT 2020


vitalybuka added inline comments.


================
Comment at: llvm/lib/Analysis/StackLifetime.cpp:78
+        continue;
+      const AllocaInst *AI = llvm::findAllocaForValue(II->getArgOperand(1));
+      if (!AI) {
----------------
ChuanqiXu wrote:
> Maybe we can't use `findAllocaForValue` to find alloca for lifetime marker. Here I find a pattern:
> ```
> a = alloca struct ...
> b = getelementptr from a
> lifetime start (b)
> /// ...
> lifetime end (b)
> ```
> And the code here would treat the lifetime span of b, which is part of a, as the whole lifetime of a. But the lifetime span of other component of a may not be the same with the lifetime span of b. I think it may cause mismatch.
Is this theoretical or something produces such patterns?
I guess we will need to fallback to HasUnknownLifetimeStartOrEnd if life does not cover entire alloca.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84630/new/

https://reviews.llvm.org/D84630



More information about the llvm-commits mailing list