[PATCH] D85555: [InstCombine] Remove dbg.values describing contents of dead allocas

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 12:40:32 PDT 2020


aprantl added a comment.

  %a = alloca i32
  store i32 1, i32* %a ; DSE kills this store.
  store i32 2, i32* %a
  dbg.value(i32* %a, "var", DW_OP_deref)
  call void @some_callee(i32* %a)
  ; Assume the alloca %a is not erased.

The salvage operation I had in mind (but didn't specify!) wouldn't trigger here:

I wrote

> We could define a new type salvage operation that looks at to-be-deleted store foo, a instructions that store to an alloca a that is used in a dbg.value(a, var, DIExpression(DW_OP_deref, expr)) that is following the store.

but this should be clarified to say

We could define a new type salvage operation that looks at to-be-deleted store foo, a instructions that store to an alloca a that is used in a dbg.value(a, var, DIExpression(DW_OP_deref, expr)) that is **immediately** following the store.

or more elaborate

We could define a new type salvage operation that looks at to-be-deleted store foo, a instructions that store to an alloca a that is used in a dbg.value(a, var, DIExpression(DW_OP_deref, expr)) that is between the store and the next store or call referencing the alloca, or another dbg.value(var).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85555



More information about the llvm-commits mailing list