dblaikie added a comment.

In D141381#4056661 <https://reviews.llvm.org/D141381#4056661>, @fdeazeve wrote:

> In hindsight, this should have been obvious.
> While SROA will not touch this:
>
>   define @foo(ptr %arg) {
>      call void @llvm.dbg.declare(%arg, [...], metadata !DIExpression())
>
> It completely destroys the debug information provided by:
>
>   define @foo(ptr %arg) {
>      %ptr_storage = alloca ptr
>      store ptr %arg, ptr %ptr_storage
>      call void @llvm.dbg.declare(%ptr_storage, [...], metadata 
> !DIExpression(DW_OP_deref))
>
> In other words, SROA rewrites the above to:
>
>   define @foo(ptr %arg) {
>      call void @llvm.dbg.declare(undef, [...], metadata 
> !DIExpression(DW_OP_deref))

Seems reasonable to me that SROA should be able to do a better/the right job 
here, for this and other places where the equivalent operation might occur... 
but this is hardly my wheelhouse/don't take that perspective as gospel.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141381

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to