[llvm] [coro][CoroSplit] Use `llvm.lifetime.end` to compute putting objects on the frame vs the stack (PR #90265)

Alan Zhao via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 13:55:17 PDT 2024


================
@@ -96,6 +96,22 @@ bool isPotentiallyReachableFromMany(
     const SmallPtrSetImpl<BasicBlock *> *ExclusionSet,
     const DominatorTree *DT = nullptr, const LoopInfo *LI = nullptr);
 
+/// Determine whether there is at least one path from a block in
+/// 'Worklist' to a block in 'StopSet' without passing through any
+///  blocks in 'ExclusionSet', returning true if uncertain.
+///
+/// Determine whether there is a path from at least one block in Worklist to
+/// at least one block in StopSet within a single function without passing
+/// through any of the blocks in 'ExclusionSet'. Returns false only if we can
+/// prove that once any block 'Worklist' has been reached then no blocks in
+/// 'StopSet' can be executed.
+/// Conservatively returns true.
+bool isManyPotentiallyReachableFromMany(
+    SmallVectorImpl<BasicBlock *> &Worklist,
+    const SmallPtrSetImpl<const BasicBlock *> &StopSet,
----------------
alanzhao1 wrote:

The `StopBB` parameter in `isPotentiallyReachableFromMany(...)` has type `const BasicBlock *`, so `StopSet` needs to be a set of `const BasicBlock *`s in order for us to implement `isPotentiallyReachableFromMany(...)` with `isManyPotentiallyReachableFromMany(...)`.

https://github.com/llvm/llvm-project/pull/90265


More information about the llvm-commits mailing list