[RFC] Instruction API changes needed to eliminate debug intrinsics from IR

Hi all,

I’ve put an introduction to this migration up here [0]. (I’ve no idea where the excess vspace comes from after the opening paragraph, not a web developer,)

We’re rapidly approaching the point where we can turn this feature on (i.e., possibly in the next couple of days) – there are a few remaining snags to address, some performance loss in non-debug builds that we can reduce, and so forth. I thought I’d outline how we see things landing and progressing:

  1. Soon, we’ll enable LLVM_EXPERIMENTAL_DEBUGINFO_ITERATORS and the --experimental-debuginfo-iterators flag by default, then wait for bug reports in case we need to do a quick revert. This will cause debug intrinsics [1] to be converted to “new” debug-info when it enters the pass manager or gets loaded from bitcode; and converted back to intrinsics when it’s written out. This will all happen “in-memory”.
  2. Assuming there’s no major turbulence from that, after a couple of weeks we’ll delete some shims we have to check/ensure output stability: some attributes re-order as a result of RemoveDIs and we don’t want to generate a lot of test updates while there’s still a risk of RemoveDIs getting turned off quickly.
  3. We’ll then land changes to the bitcode IR format and the textual IR format, providing some scripts and switches to ease downtstream adoption.

The aim of this plan is to hopefully get LLVM operating in memory without using intrinsics ASAP, converting back to intrinsics at the terminals, so that we can get this feature on and being tested without burdening anyone with immediate test maintenance. We can then spread the transition to a new output format over the course of LLVM19, instead of trying to make everything happen at once.

[0] https://llvm.org/docs/RemoveDIsDebugInfo.html
[1] Except dbg.label, that’s still coming.


Thanks,
Jeremy

2 Likes