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

Alan Zhao via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 20:32:03 PDT 2024


alanzhao1 wrote:

> The code duplication is slightly not good. Can we try to mitigate such problems by some template techniques?
> 
> For example, (may be):
> 
> ```
> if constexpr (isMany) {
>     if (StopSet.contains(BB))
>       return true;
> } else {
>     if (BB == StopBB) // or BB == *StopSet.begin()
>       return true;
> }
> ```

Hmm...would making `StopBB`/`StopSet` a `std::variant<const BasicBlock *,  const SmallPtrSetImpl<const BasicBlock *> &>` work?

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


More information about the llvm-commits mailing list