[llvm] Add code to handle llvm.dbg.values in SROA. (PR #94068)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 06:06:32 PDT 2024
================
@@ -43,6 +43,8 @@ class Module;
TinyPtrVector<DbgDeclareInst *> findDbgDeclares(Value *V);
/// As above, for DVRDeclares.
TinyPtrVector<DbgVariableRecord *> findDVRDeclares(Value *V);
+/// As above, for DVRValues.
+TinyPtrVector<DbgVariableRecord *> findDVRValues(Value *V);
----------------
SLTozer wrote:
There are cases where we only want to handle specific types - in SROA for example, as part of migrating dbg.declare and dbg.assign users of an alloca, we remove duplicate dbg.declares for the same variable at the new alloca fragments, which uses `findDVRDeclares` specifically.
We do have a generic version, `findDbgUsers()` which fetches all debug intrinsics and records that use a given value; in this specific case though, I think it's fine that we add this, because we do want to be able to handle them separately and also not include assigns (which we want to get slightly differently in SROA than just finding value users).
https://github.com/llvm/llvm-project/pull/94068
More information about the llvm-commits
mailing list