[PATCH] D96938: [RFC] [Coroutine] [Debug] Insert dbg.declare to entry.resume to print alloca in the coroutine frame under O2

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 19:36:35 PST 2021


ChuanqiXu added a comment.

In D96938#2601444 <https://reviews.llvm.org/D96938#2601444>, @aprantl wrote:

> I looked at your example in the debugger and the problem seems to be that SROA is being run before LowerDbgDeclare (from Local.cpp). I believe reversing the order might work. Alternatively we could just not create an alloca in coro::salvageDebugInfo if optimizations are enabled, but I am not sure if this is known to the pass.

It looks OK to skip the creation for the alloca if optimizations are enabled.



================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2196
+  // passes and the corresponding dbg.declares would be invalid.
+  if (!IsOptimizing && !EnableCoroutineOptimization)
+    if (auto *Arg = dyn_cast_or_null<llvm::Argument>(Storage)) {
----------------
This style looks really ugly. Is there any way to fix it? Can we use a goto in the if statement?


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

https://reviews.llvm.org/D96938



More information about the llvm-commits mailing list