[llvm-bugs] [Bug 42091] New: [ms] Template backref mangling is orders of magnitude slower than in Itanium ABI
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri May 31 07:06:16 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42091
Bug ID: 42091
Summary: [ms] Template backref mangling is orders of magnitude
slower than in Itanium ABI
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: nicolasweber at gmx.de
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Nicos-MacBook-Pro:llvm-project thakis$ cat test.cc
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7,
class T8, class T9, class T10>
struct Fooob {
int f() { return 0; }
};
using A0 = Fooob<int, int, int, int, int, int, int, int, int, int>;
using A1 = Fooob<A0, A0, A0, A0, A0, A0, A0, A0, A0, A0>;
using A2 = Fooob<A1, A1, A1, A1, A1, A1, A1, A1, A1, A1>;
using A3 = Fooob<A2, A2, A2, A2, A2, A2, A2, A2, A2, A2>;
using A4 = Fooob<A3, A3, A3, A3, A3, A3, A3, A3, A3, A3>;
using A5 = Fooob<A4, A4, A4, A4, A4, A4, A4, A4, A4, A4>;
using A6 = Fooob<A5, A5, A5, A5, A5, A5, A5, A5, A5, A5>;
using A7 = Fooob<A6, A6, A6, A6, A6, A6, A6, A6, A6, A6>;
void f(A7 a) {}
$ time out/gn/bin/clang -c test.cc
real 0m0.063s
user 0m0.017s
sys 0m0.020s
$ time out/gn/bin/clang-cl /c test.cc
real 0m7.110s
user 0m7.081s
sys 0m0.020s
Here's the top of a profiling session
7.31 s 100.0% 0 s Main Thread 0x32dc27
7.30 s 99.9% 0 s start
7.30 s 99.9% 0 s main
7.30 s 99.8% 0 s cc1_main(llvm::ArrayRef<char const*>, char
const*, void*)
7.29 s 99.8% 0 s
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
7.29 s 99.8% 0 s
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
7.29 s 99.7% 0 s clang::FrontendAction::Execute()
7.29 s 99.7% 0 s clang::ParseAST(clang::Sema&, bool,
bool)
7.27 s 99.4% 0 s
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
7.27 s 99.4% 0 s (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
7.27 s 99.4% 0 s
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
7.27 s 99.4% 0 s
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
7.27 s 99.4% 0 s
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
7.26 s 99.4% 0 s
clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl,
llvm::Type*, bool, bool, clang::CodeGen::ForDefinition_t)
7.26 s 99.4% 0 s
clang::CodeGen::CodeGenModule::getMangledName(clang::GlobalDecl)
7.26 s 99.3% 0 s
getMangledNameImpl(clang::CodeGen::CodeGenModule const&, clang::GlobalDecl,
clang::NamedDecl const*, bool)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftMangleContextImpl::mangleCXXName(clang::NamedDecl const*,
llvm::raw_ostream&)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleFunctionType(clang::FunctionType
const*, clang::FunctionDecl const*, bool, bool)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleArgumentType(clang::QualType,
clang::SourceRange)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.26 s 99.3% 0 s (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.26 s 99.3% 2.00 ms (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.25 s 99.2% 2.00 ms (anonymous
namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.24 s 99.0% 1.00 ms (anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
7.22 s 98.7% 4.00 ms (anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
7.17 s 98.1% 25.00 ms
(anonymous namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
7.08 s 96.8% 21.00 ms
(anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
6.99 s 95.6% 71.00 ms
(anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
6.78 s 92.7% 251.00 ms
(anonymous namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
5.79 s 79.2% 264.00 ms
(anonymous
namespace)::MicrosoftCXXNameMangler::mangleUnqualifiedName(clang::NamedDecl
const*, clang::DeclarationName)
4.93 s 67.4% 592.00 ms
(anonymous
namespace)::MicrosoftCXXNameMangler::mangleTemplateInstantiationName(clang::TemplateDecl
const*, clang::TemplateArgumentList const&)
3.20 s 43.8% 1.44 s
(anonymous namespace)::MicrosoftCXXNameMangler::mangleType(clang::QualType,
clang::SourceRange, (anonymous
namespace)::MicrosoftCXXNameMangler::QualifierMangleMode)
880.00 ms 12.0% 325.00 ms
llvm::raw_ostream::write(unsigned char)
524.00 ms 7.1% 212.00 ms
clang::QualType::getDesugaredType(clang::QualType,
clang::ASTContext const&)
291.00 ms 3.9% 291.00 ms
clang::ASTContext::getAsArrayType(clang::QualType) const
71.00 ms 0.9% 0 s
<Unknown Address>
367.00 ms 5.0% 137.00 ms
(anonymous
namespace)::MicrosoftCXXNameMangler::mangleSourceName(llvm::StringRef)
At first sight, the TypeBackReferences cache is only used in mangleArgumentType
which is only called in mangleFunctionType.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190531/688438bf/attachment-0001.html>
More information about the llvm-bugs
mailing list