[llvm] r252219 - DI: Reverse direction of subprogram -> function edge.

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 16:43:29 PST 2015


> On 2015-Nov-05, at 14:04, Peter Collingbourne via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: pcc
> Date: Thu Nov  5 16:03:56 2015
> New Revision: 252219
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=252219&view=rev
> Log:
> 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
> 
> Added:
>   llvm/trunk/test/Bitcode/upgrade-subprogram.ll
>     - copied, changed from r252217, llvm/trunk/test/Linker/Inputs/subprogram-linkonce-weak.ll
>   llvm/trunk/test/Bitcode/upgrade-subprogram.ll.bc
> Modified:
>   llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp
>   llvm/trunk/bindings/go/llvm/DIBuilderBindings.h
>   llvm/trunk/bindings/go/llvm/IRBindings.cpp
>   llvm/trunk/bindings/go/llvm/IRBindings.h
>   llvm/trunk/bindings/go/llvm/dibuilder.go
>   llvm/trunk/bindings/go/llvm/ir.go
>   llvm/trunk/include/llvm/IR/DIBuilder.h
>   llvm/trunk/include/llvm/IR/DebugInfo.h
>   llvm/trunk/include/llvm/IR/DebugInfoMetadata.h

[snip]

Please update LangRef too (sorry I missed this pre-commit).


More information about the llvm-commits mailing list