[Mlir-commits] [mlir] [mlir] Add importedEntities field in DIComplileUnitAttr. (PR #188576)
Christian Ulmann
llvmlistbot at llvm.org
Thu Apr 2 08:50:43 PDT 2026
Dinistro wrote:
It seems that these `importedEntities` can form cyclic structures in LLVM IR. Feeding such an input to the importer causes a crash.
An example input is
```
source_filename = "reduced.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@__lookup_table_f64_log_coarse = external constant [512 x i128], !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!17}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "__lookup_table_f64_log_coarse", scope: !2, file: !12, line: 7, type: !13, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.1.7", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !5, splitDebugInlining: false, nameTableKind: None)
!3 = !DIFile(filename: "f64_log.cpp", directory: "/build")
!4 = !{}
!5 = !{!6}
!6 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !7, file: !11, line: 10)
!7 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "fma_u128_t", scope: !9, file: !8, line: 495, size: 128, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !4, identifier: "_ZTSN3foo5types10fma_u128_tE")
!8 = !DIFile(filename: "fma_definitions.hpp", directory: "/build")
!9 = !DINamespace(name: "types", scope: !10)
!10 = !DINamespace(name: "foo", scope: null)
!11 = !DIFile(filename: "arithmetic_helpers.hpp", directory: "/build")
!12 = !DIFile(filename: "f64_log_coarse.hpp", directory: "/build")
!13 = !DICompositeType(tag: DW_TAG_array_type, baseType: !14, size: 65536, elements: !4)
!14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !15)
!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "__uint128_t", file: !3, baseType: !16)
!16 = !DIBasicType(name: "unsigned __int128", size: 128, encoding: DW_ATE_unsigned)
!17 = !{i32 2, !"Debug Info Version", i32 3}
```
https://github.com/llvm/llvm-project/pull/188576
More information about the Mlir-commits
mailing list