[clang] [llvm] [polly] [DebugInfo] Remove dead debug intrinsic handling (NFC) (PR #231379)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 00:32:33 PDT 2026


kazutakahirata wrote:

> LGTM. Is DXIL the only remaining user? (We also have Instruction::isDebugOrPseudoInst(), which should (probably separately) be replaced with `isa<PseudoProbeInst>()` or removed (with preference to removal).)

Thanks for the review!

Yes. In production `llvm/` code, the DirectX backend is the only remaining caller of `Module::convertFromNewDbgValues()` in `DXILDebugInfo.cpp`, which materializes `DbgRecord`s back into debug intrinsics right before serializing to LLVM 3.7-based DXIL bitcode.

Outside of DirectX, the only remaining references to `Dbg*Intrinsic` / `Intrinsic::dbg_*` are:
- The bitcode/IR reader upgrade path:
  - `AutoUpgrade.cpp`
  - `BitcodeReader.cpp`
  - `LLParser.cpp`
- Dead debug-intrinsic handling in subprojects:
  - `mlir/lib/Target/LLVMIR/ModuleImport.cpp`
  - `lldb/source/Expression/IRInterpreter.cpp`
- `StripDebugDeclarePass` in `StripSymbols.cpp`, which only checks for `Intrinsic::dbg_declare` and is now a no-op
- `LLVM_FOR_EACH_VALUE_SUBCLASS` in `llvm-c/Core.h`
- Unit tests:
  - `BitReaderTest.cpp`
  - `CloningTest.cpp`
  - `DebugInfoTest.cpp`
  - `MetadataTest.cpp`

Agreed on `Instruction::isDebugOrPseudoInst()`. I'll follow up with a separate patch to replace its call sites with `isa<PseudoProbeInst>()` and remove `Instruction::isDebugOrPseudoInst()`.

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


More information about the cfe-commits mailing list