[all-commits] [llvm/llvm-project] d7693e: [MLIR][LLVM] Add variant part debug info support (...
jiel-nv via All-commits
all-commits at lists.llvm.org
Mon May 4 11:43:34 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d7693e331ce97193e8ae9c3a2b2ee1302bc6ae63
https://github.com/llvm/llvm-project/commit/d7693e331ce97193e8ae9c3a2b2ee1302bc6ae63
Author: jiel-nv <37816794+jiel-nv at users.noreply.github.com>
Date: 2026-05-04 (Mon, 04 May 2026)
Changed paths:
M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
M mlir/include/mlir-c/Dialect/LLVM.h
M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
M mlir/include/mlir/Dialect/LLVMIR/LLVMDialectBytecode.td
M mlir/lib/CAPI/Dialect/LLVM.cpp
M mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
M mlir/lib/Target/LLVMIR/DebugImporter.cpp
M mlir/lib/Target/LLVMIR/DebugTranslation.cpp
M mlir/test/CAPI/llvm.c
M mlir/test/Dialect/LLVMIR/debuginfo.mlir
M mlir/test/Dialect/LLVMIR/types-invalid.mlir
M mlir/test/Target/LLVMIR/Import/debug-info.ll
M mlir/test/Target/LLVMIR/llvmir-debug.mlir
Log Message:
-----------
[MLIR][LLVM] Add variant part debug info support (#195321)
#### Summary
This PR extends the MLIR LLVM dialect debug-info attributes to represent
DWARF variant parts, discriminators, and per-alternative discriminator
values.
The change adds `identifier` and `discriminator` support to
`DICompositeTypeAttr`, allowing MLIR to model `DW_TAG_variant_part`
metadata that LLVM IR already supports. It also broadens
`DIDerivedTypeAttr`'s `extraData` field from `DINodeAttr` to a verified
polymorphic `Attribute`, supporting both debug-info nodes and integer
constants used by variant alternatives.
#### Details
- Add `identifier` and `discriminator` fields to `DICompositeTypeAttr`,
bytecode serialization, LLVM IR import/export, C API bindings, and Flang
call sites.
- Change `DIDerivedTypeAttr.extraData` to accept either `DINodeAttr` or
`IntegerAttr`, with verifier coverage for invalid attribute kinds.
- Preserve integer bit width when importing
`ConstantAsMetadata(ConstantInt)` into MLIR.
- Add parse/print, verifier, LLVM IR import/export, and C API test
coverage for variant-part debug info.
---------
Co-authored-by: Tobias Gysi <tobias.gysi at nextsilicon.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list