[PATCH] D124098: Don't replace Undef with null value for Constants

ykhatav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 09:33:33 PDT 2022


ykhatav updated this revision to Diff 424940.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124098/new/

https://reviews.llvm.org/D124098

Files:
  llvm/test/DebugInfo/X86/undef-type-md.ll


Index: llvm/test/DebugInfo/X86/undef-type-md.ll
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/X86/undef-type-md.ll
@@ -0,0 +1,36 @@
+; RUN:  opt -S -ipsccp %S/undef-type-md.ll | FileCheck %s
+; CHECK: llvm.nondebug.metadata = !{[[NONDEBUG_METADATA:![0-9]+]]}
+; CHECK: [[NONDEBUG_METADATA]] =  distinct !{null} 
+; CHECK: !DITemplateValueParameter({{.*}} value: %class.1 addrspace(1)* undef)
+
+; ModuleID = '<stdin>'
+source_filename = "test.cpp"
+
+%"struct.1" = type <{ float, i32, i8, [3 x i8] }>
+%"class.1" = type { %"struct.1" }
+
+ at extern_const = external addrspace(1) constant { { float, i32, i8 } }
+
+; Function Attrs: convergent mustprogress norecurse
+define linkonce_odr spir_func void @foo() align 2 !dbg !5 {
+entry:
+  %0 = alloca %"class.1", align 8
+  ret void
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4}
+!llvm.nondebug.metadata= !{!11}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang", isOptimized: true, emissionKind: FullDebug)
+!1 = !DIFile(filename: "test.cpp", directory: "/path/to")
+!2 = !{}
+!3 = !{i32 7, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = distinct !DISubprogram(name: "foo<param>", scope: !1, file: !1, line: 27, type: !6, scopeLine: 27, spFlags: DISPFlagDefinition, unit: !0, templateParams: !8)
+!6 = !DISubroutineType(types: !7)
+!7 = !{null}
+!8 = !{!9}
+!9 = !DITemplateValueParameter(name: "S", type: !10, value: %"class.1" addrspace(1)* bitcast ({ { float, i32, i8 } } addrspace(1)* @extern_const to %"class.1" addrspace(1)*))
+!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!11 = !{%"class.1" addrspace(1)* bitcast ({ { float, i32, i8 } } addrspace(1)* @extern_const to %"class.1" addrspace(1)*)}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124098.424940.patch
Type: text/x-patch
Size: 1818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220425/6f96c8db/attachment.bin>


More information about the llvm-commits mailing list