[llvm] [Coroutines] Make CoroElide actually work for (trivial) C++ coroutines (PR #92969)

Wei Wang via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 13:31:56 PDT 2024


================
@@ -193,23 +195,51 @@ CoroIdElider::CoroIdElider(CoroIdInst *CoroId, FunctionElideInfo &FEI,
       CoroAllocs.push_back(CA);
   }
 
+  DenseMap<AllocaInst *, CoroBeginInst *> Writes;
+  for (CoroBeginInst *CB : CoroBegins) {
+    for (User *U : CB->users()) {
+      if (auto *Store = dyn_cast<StoreInst>(U)) {
----------------
apolloww wrote:

Have we seen case of the alloca stores into another alloca?

I think we can use a worklist here to catch all the allocas that alias with the corobegin.  

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


More information about the llvm-commits mailing list