[llvm] [RemoveDIs][DebugInfo] Handle RAUW from dead constants (PR #80837)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 07:40:44 PST 2024


OCHyams wrote:

I think my summary here https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value/65019/5 is still relevant -- the natural path in llvm is to introduce nullptrs in some places (which become `!{}`), and undef/poison in others. Both should be handled as "kill locations". Since we deleted the troublesome bit of code that was treating nullptr-ed dbg intrinsics as "safe to clean up" that is true; that is to say they're semantically equivalent today.

> Hopefully this also paves the way to eliminating instances of empty MDNodes appearing in DPValues at any time as well, but there may be other cases that introduce them as well (@OCHyams may be familiar?).

Since we now have the ability to catch these nullptrs in the debug record itself rather than in the more general MetadataAsValue wrapper used in dbg intrinsics, it makes sense to canonicalize things.

We could remove the "empty metadata tuple" bit in the docs https://llvm.org/docs/SourceLevelDebugging.html once we eliminate debug intrinscs entirely.

> LGTM -- there are a few nullptrs leaking in from abnormal freeing-of-values paths, it'll be good to have this catch-all.

^ I agree.


https://github.com/llvm/llvm-project/pull/80837


More information about the llvm-commits mailing list