diff options
| author | Davide Italiano <davide@freebsd.org> | 2016-04-13 20:17:42 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2016-04-13 20:17:42 +0000 |
| commit | 236e7444ddfcff46e36800636cf14e1658af5794 (patch) | |
| tree | bc1b80890f093f80187fd581d6e86088a604e93c /llvm/unittests/IR | |
| parent | 785b5a895081325aaa574477c132f33ef03ed9e0 (diff) | |
| download | bcm5719-llvm-236e7444ddfcff46e36800636cf14e1658af5794.tar.gz bcm5719-llvm-236e7444ddfcff46e36800636cf14e1658af5794.zip | |
[DebugInfo] Optimize memory layout of DISubprogram.
A DISubprogram on x86_64 was 48 bytes. During an LTO build we
end up allocating *a lot* of these (see Duncan's numbers on
llvm-dev and/or my numbers in the review link).
This change reduces the size to 40 bytes, with a nice effect
on peak memory usage when LTO'ing clang.
There are more classes in the hierarchy which can be compacted
so more patches will come. DISubprogram was the biggest offender
in my profiling, anyway.
Differential Revision: http://reviews.llvm.org/D18918
llvm-svn: 266241
Diffstat (limited to 'llvm/unittests/IR')
| -rw-r--r-- | llvm/unittests/IR/MetadataTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index 5c53ec74ab8..40590445f70 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -1413,9 +1413,10 @@ TEST_F(DISubprogramTest, get) { bool IsDefinition = true; unsigned ScopeLine = 3; DITypeRef ContainingType = getCompositeType(); - unsigned Virtuality = 4; + unsigned Virtuality = 2; unsigned VirtualIndex = 5; unsigned Flags = 6; + unsigned NotFlags = (~Flags) & ((1 << 27) - 1); bool IsOptimized = false; MDTuple *TemplateParams = getTuple(); DISubprogram *Declaration = getSubprogram(); @@ -1513,7 +1514,7 @@ TEST_F(DISubprogramTest, get) { EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition, ScopeLine, ContainingType, Virtuality, VirtualIndex, - ~Flags, IsOptimized, TemplateParams, + NotFlags, IsOptimized, TemplateParams, Declaration, Variables)); EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition, ScopeLine, |

