Index: lib/Linker/IRMover.cpp =================================================================== --- lib/Linker/IRMover.cpp +++ lib/Linker/IRMover.cpp @@ -1062,6 +1062,7 @@ ValueMap.MD()[CU->getRawEnumTypes()].reset(nullptr); ValueMap.MD()[CU->getRawMacros()].reset(nullptr); ValueMap.MD()[CU->getRawRetainedTypes()].reset(nullptr); + ValueMap.MD()[CU->getRawGlobalVariables()].reset(nullptr); // Imported entities only need to be mapped in if they have local // scope, as those might correspond to an imported entity inside a Index: test/ThinLTO/X86/index-const-prop.ll =================================================================== --- test/ThinLTO/X86/index-const-prop.ll +++ test/ThinLTO/X86/index-const-prop.ll @@ -21,7 +21,7 @@ ; IMPORT: @gFoo.llvm.0 = internal unnamed_addr global i32 1, align 4, !dbg !0 ; IMPORT-NEXT: @gBar = internal local_unnamed_addr global i32 2, align 4, !dbg !5 -; IMPORT: !DICompileUnit({{.*}}, globals: !{{[0-9]+}}) +; IMPORT: !DICompileUnit({{.*}}) ; OPTIMIZE: define i32 @main ; OPTIMIZE-NEXT: ret i32 3 Index: test/ThinLTO/X86/index-const-prop2.ll =================================================================== --- test/ThinLTO/X86/index-const-prop2.ll +++ test/ThinLTO/X86/index-const-prop2.ll @@ -34,7 +34,7 @@ ; IMPORT: @gFoo.llvm.0 = internal unnamed_addr global i32 1, align 4 ; IMPORT-NEXT: @gBar = internal local_unnamed_addr global i32 2, align 4 -; IMPORT: !DICompileUnit({{.*}}, globals: !{{[0-9]+}}) +; IMPORT: !DICompileUnit({{.*}}) ; CODEGEN: i32 @main() ; CODEGEN-NEXT: ret i32 3