[PATCH] D97673: [RFC] [[Coroutine] [Debug] Salvage dbg.values

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 09:03:46 PST 2021


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2515
+    if (auto *InsertPt = dyn_cast<Instruction>(Storage))
+      DVI->moveAfter(InsertPt);
+    else if (isa<Argument>(Storage))
----------------
StephenTozer wrote:
> hoy wrote:
> > I've seen this caused issue when `Storage` is a block terminator, e.g, an invoke instruction returning a piece of allocated memory. I don't quite get the full context of how we are salvaging debug info, but do you think we can just skip such case here?
> Not my patch, but do you have a reproducer for this? I'm not sure what circumstances are causing `Storage` to be a block terminator, but it doesn't sound like something that should happen.
I've been trying to get a small repro with llvm-reduce which has already run 12 hours on our internal giant functions resulted by a combination of AutoFDO and aggressive inlining.  The block terminator I'm seeing is an invoke instruction calling `new` and the code here result in the following pattern 


```
%3516 = invoke noalias nonnull i8* @_Znwm(i64 120) #79 to label %3517 unwind label %3585, !dbg !332197 
call void @llvm.dbg.declare(metadata i8* %3516, metadata !332198, metadata !DIExpression(DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 56)), !dbg !332217 
call void @llvm.dbg.declare(metadata i8* %3516, metadata !332278, metadata !DIExpression(DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8)), !dbg !332298
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97673



More information about the llvm-commits mailing list