[PATCH] D110782: Mark PassBuilder::addPass() as minsize
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 29 15:27:50 PDT 2021
aeubanks created this revision.
aeubanks added a reviewer: rnk.
Herald added a subscriber: dexonsmith.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This makes PassBuilder.o a little faster to compile and a little smaller
as well.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D110782
Files:
llvm/include/llvm/IR/PassManager.h
llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
Index: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
===================================================================
--- llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
+++ llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
@@ -103,6 +103,7 @@
/// to the end of \var IsLoopNestPass so we can easily identify the types of
/// passes in the pass manager later.
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<is_detected<HasRunOnLoopT, PassT>::value>
addPass(PassT &&Pass) {
using LoopPassModelT =
@@ -114,6 +115,7 @@
}
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<!is_detected<HasRunOnLoopT, PassT>::value>
addPass(PassT &&Pass) {
using LoopNestPassModelT =
@@ -129,6 +131,7 @@
// `RepeatedPass` has a templated `run` method that will result in incorrect
// detection of `HasRunOnLoopT`.
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<is_detected<HasRunOnLoopT, PassT>::value>
addPass(RepeatedPass<PassT> &&Pass) {
using RepeatedLoopPassModelT =
@@ -141,6 +144,7 @@
}
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<!is_detected<HasRunOnLoopT, PassT>::value>
addPass(RepeatedPass<PassT> &&Pass) {
using RepeatedLoopNestPassModelT =
Index: llvm/include/llvm/IR/PassManager.h
===================================================================
--- llvm/include/llvm/IR/PassManager.h
+++ llvm/include/llvm/IR/PassManager.h
@@ -548,6 +548,7 @@
}
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<!std::is_same<PassT, PassManager>::value>
addPass(PassT &&Pass) {
using PassModelT =
@@ -564,6 +565,7 @@
/// implementation complexity and avoid potential invalidation issues that may
/// happen with nested pass managers of the same type.
template <typename PassT>
+ __attribute__((minsize))
std::enable_if_t<std::is_same<PassT, PassManager>::value>
addPass(PassT &&Pass) {
for (auto &P : Pass.Passes)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110782.376054.patch
Type: text/x-patch
Size: 2049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210929/b9209e5c/attachment.bin>
More information about the llvm-commits
mailing list