From d4bff30370db9f2cb13838897012768739cf1ee0 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 5 Nov 2015 22:03:56 +0000 Subject: DI: Reverse direction of subprogram -> function edge. Previously, subprograms contained a metadata reference to the function they described. Because most clients need to get or set a subprogram for a given function rather than the other way around, this created unneeded inefficiency. For example, many passes needed to call the function llvm::makeSubprogramMap() to build a mapping from functions to subprograms, and the IR linker needed to fix up function references in a way that caused quadratic complexity in the IR linking phase of LTO. This change reverses the direction of the edge by storing the subprogram as function-level metadata and removing DISubprogram's function field. Since this is an IR change, a bitcode upgrade has been provided. Fixes PR23367. An upgrade script for textual IR for out-of-tree clients is attached to the PR. Differential Revision: http://reviews.llvm.org/D14265 llvm-svn: 252219 --- llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll') diff --git a/llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll b/llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll index 6b6d8e4c84e..6aaf594b305 100644 --- a/llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll +++ b/llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -mem2reg -S | FileCheck %s -define double @testfunc(i32 %i, double %j) nounwind ssp { +define double @testfunc(i32 %i, double %j) nounwind ssp !dbg !1 { entry: %i_addr = alloca i32 ; [#uses=2] %j_addr = alloca double ; [#uses=2] @@ -36,7 +36,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.module.flags = !{!14} !0 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !7) -!1 = distinct !DISubprogram(name: "testfunc", linkageName: "testfunc", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !12, scope: !2, type: !4, function: double (i32, double)* @testfunc) +!1 = distinct !DISubprogram(name: "testfunc", linkageName: "testfunc", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !12, scope: !2, type: !4) !2 = !DIFile(filename: "testfunc.c", directory: "/tmp") !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !12, enums: !13, retainedTypes: !13, subprograms: !{!1}) !4 = !DISubroutineType(types: !5) -- cgit v1.2.3