[PATCH] D141381: [codegen] Store address of indirect arguments on the stack

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 08:33:13 PST 2023


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



More information about the cfe-commits mailing list