Commit
9895c7012d61525ed541ef74d9eb43300bac9b0c
by kazu[InlineCost] Implement cost-benefit-based inliner
This patch adds an alternative cost metric for the inliner to take into account both the cost (i.e. size) and cycle count savings into account.
Without this patch, we decide to inline a given call site if the size of inlining the call site is below the threshold that is computed according to the hotness of the call site.
This patch adds a new cost metric, turned off by default, to take over the handling of hot call sites. Specifically, with the new cost metric, we decide to inline a given call site if the ratio of cycle savings to size exceeds a threshold. The cycle savings are computed from call site costs, parameter propagation, folded conditional branches, etc, all weighted by their respective profile counts. The size is primarily the callee size, but we subtract call site costs and the size of basic blocks that are never executed.
The new cost metric implicitly takes advantage of the machine function splitter recently introduced by Snehasish Kumar, which dramatically reduces the cost of duplicating (e.g. inlining) cold basic blocks by placing cold basic blocks of hot functions in the .text.split section.
We evaluated the new cost metric on clang bootstrap and SPECInt 2017.
For clang bootstrap, we observe 0.69% runtime improvement.
For SPECInt we report the change in IntRate the C/C++ benchmarks. All benchmarks apart from perlbench and omnetpp improve, on average by 0.21% with the max for mcf at 1.96%.
Benchmark % Change 500.perlbench_r -0.45 502.gcc_r 0.13 505.mcf_r 1.96 520.omnetpp_r -0.28 523.xalancbmk_r 0.49 525.x264_r 0.00 531.deepsjeng_r 0.00 541.leela_r 0.35 557.xz_r 0.21
Differential Revision: https://reviews.llvm.org/D92780
|
 | llvm/lib/Analysis/InlineCost.cpp |
Commit
ff4b76d74f38a3816495c9914789e87a95525cf4
by jan_svoboda[clang][cli] Port TargetOpts simple string based options to new option parsing system
Depends on D84190
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84668
|
 | clang/lib/Frontend/CompilerInvocation.cpp |
 | clang/include/clang/Driver/Options.td |
Commit
aec2991d083a9c5b92f94d84a7b3a7bbed405af8
by jan_svoboda[clang][cli] Port LangOpts simple string based options to new option parsing system
Depends on D84670
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84671
|
 | clang/include/clang/Driver/Options.td |
 | clang/lib/Frontend/CompilerInvocation.cpp |
 | clang/include/clang/Basic/DiagnosticFrontendKinds.td |
Commit
d1b3f82e51378dd9fb5a23806d8fa906151f5e7b
by jan_svoboda[clang][cli] Port PreprocessorOpts simple string based options to new option parsing system
Depends on D84671
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84672
|
 | clang/lib/Frontend/CompilerInvocation.cpp |
 | clang/include/clang/Driver/Options.td |
Commit
333d41e9eb8b5f6cd67d318e84ee8dba99b840cc
by jan_svoboda[clang][cli] Port FrontendOpts simple string based options to new option parsing system
Depends on D84189
Reviewed By: dexonsmith
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84190
|
 | clang/include/clang/Driver/Options.td |
 | clang/lib/Frontend/CompilerInvocation.cpp |
Commit
9e08e51a20d0d2b1c5724bb17e969d036fced4cd
by richard[c++20] P1907R1: Support for generalized non-type template arguments of scalar type.
|
 | clang/lib/Serialization/ASTWriter.cpp |
 | clang/lib/AST/StmtProfile.cpp |
 | clang/lib/AST/MicrosoftMangle.cpp |
 | clang/lib/AST/ODRHash.cpp |
 | clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp |
 | clang/lib/Index/USRGeneration.cpp |
 | clang/test/CodeGenCXX/template-arguments.cpp |
 | clang/include/clang/AST/TemplateArgumentVisitor.h |
 | clang/include/clang/AST/PropertiesBase.td |
 | clang/lib/Sema/SemaTemplateInstantiate.cpp |
 | clang/lib/AST/ASTContext.cpp |
 | clang/lib/CodeGen/CGDebugInfo.cpp |
 | clang/lib/AST/ItaniumMangle.cpp |
 | clang/lib/AST/TypeLoc.cpp |
 | clang/lib/AST/ASTStructuralEquivalence.cpp |
 | clang/lib/AST/ASTImporter.cpp |
 | clang/include/clang/Serialization/ASTRecordWriter.h |
 | clang/include/clang/AST/RecursiveASTVisitor.h |
 | clang/lib/Sema/SemaTemplateDeduction.cpp |
 | clang/test/CodeGenCXX/mangle-ms-templates.cpp |
 | clang/include/clang/Sema/Sema.h |
 | clang/test/SemaTemplate/temp_arg_nontype_cxx17.cpp |
 | clang/include/clang/AST/TemplateBase.h |
 | clang/lib/Sema/SemaTemplate.cpp |
 | clang/lib/Sema/TreeTransform.h |
 | clang/tools/libclang/CXCursor.cpp |
 | clang/test/CodeGenCXX/mangle-template.cpp |
 | clang/lib/Sema/SemaLookup.cpp |
 | clang/lib/AST/TemplateBase.cpp |
 | clang/include/clang/Basic/DiagnosticSemaKinds.td |
 | clang/lib/Sema/SemaOverload.cpp |
 | clang/lib/Sema/SemaTemplateVariadic.cpp |
 | clang/lib/Serialization/ASTReader.cpp |
 | clang/lib/CodeGen/CGExprConstant.cpp |
 | clang/lib/AST/Decl.cpp |
 | clang/tools/libclang/CIndex.cpp |
Commit
569676c05725d79909bd8a9224bc709bd621553c
by richardMake Expr::HasSideEffect more precise for instantiation-dependent expressions.
Fixes a regression in the clang-tidy test suite from making DeclRefExprs referring to dependent declarations be instantiation-dependent.
|
 | clang/lib/AST/Expr.cpp |
 | clang/lib/Sema/SemaExprCXX.cpp |
 | clang/lib/Sema/SemaType.cpp |
 | clang/lib/Sema/SemaExpr.cpp |
Commit
e83e0cac041bc071301f8399bb5c32b2529fc83f
by martin[libcxx] Make filesystem::path::value_type wchar_t on windows
Also set the preferred separator to backslash.
libc++ doesn't compile successfully for windows prior to this change, and this change on its own isn't enough to make it compile successfully either, but is the first stepping stone towards making it work correctly.
Most of operations.cpp will need to be touched, both for calling functions that take wchar paths, but also for using other windows specific functions instead of the posix functions used so far; that is handled in later commits.
Changing parts of operations.cpp to generalize the string type handling in code that doesn't touch system functions.
Differential Revision: https://reviews.llvm.org/D91135
|
 | libcxx/include/filesystem |
 | libcxx/src/filesystem/filesystem_common.h |
 | libcxx/src/filesystem/operations.cpp |
Commit
48c6500b5bfa60dfe6ca5f407fcdbf5ddff0c289
by martin[libcxx] Reorder the two u8path functions, to make the following diff more readable. NFC.
Differential Revision: https://reviews.llvm.org/D91136
|
 | libcxx/include/filesystem |
Commit
de698ae73444b5160dd6b8d768b30d6764be004e
by martin[libcxx] Convert paths to/from the right narrow code page for narrow strings on windows
On windows, the narrow, char based paths normally don't use utf8, but can use many different native code pages, and this is what system functions that operate on files, taking such paths/file names, interpret them as.
Differential Revision: https://reviews.llvm.org/D91137
|
 | libcxx/src/filesystem/operations.cpp |
 | libcxx/include/filesystem |
 | libcxx/src/filesystem/filesystem_common.h |
Commit
156180727d6c347eda3ba749730707acb8a48093
by martin[libcxx] Fix the preexisting directory_iterator code for windows
The directory_iterator.cpp file did contain an incomplete, non-working implementation for windows.
Change it to use the wchar version of the APIs.
Don't set the windows specific errors from GetLastError() as code in the generic category; remap the errors to the std::errc values.
Error out cleanly on empty paths.
Invoke FindFirstFile on <directoryname>/* to actually list the entries of the directory.
If the first entry retured by FindFirstFile is to be skipped (e.g. being "." or ".."), call advance() (which calls FindNextFile and loops) which doesn't return until a valid entry is found (or the end is reached).
Differential Revision: https://reviews.llvm.org/D91140
|
 | libcxx/src/filesystem/operations.cpp |
 | libcxx/src/filesystem/directory_iterator.cpp |
 | libcxx/src/filesystem/filesystem_common.h |
Commit
95d3cc67caac04668ef808f65c30ced60ed14f5d
by jan_svoboda[clang][cli] Port CodeGenOpts simple string flags to new option parsing system
Depends on D84668
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84669
|
 | clang/include/clang/Basic/DiagnosticDriverKinds.td |
 | clang/include/clang/Driver/Options.td |
 | clang/include/clang/Basic/CodeGenOptions.h |
 | clang/lib/Frontend/CompilerInvocation.cpp |
 | clang/test/Profile/c-generate.c |