Skip to content

Commit ec7a5b4

Browse files
authored
[Option] Mark getLastArg(NoClaim) as noinline. (#157163)
After #156730, getLastArg(NoClaim) are now just below the inlining threshold and inlining them causes +0.44% code size increase for Clang and a corresponding compile-time increase without helping compile-time. Mark them as noinline to recover the original codesize. http://llvm-compile-time-tracker.com/compare.php?from=a271d07488a85ce677674bbe8101b10efff58c95&to=3b7b312476da2a2b1fd44815532edf9987da337e&stat=instructions:u PR: #157163
1 parent f562e2a commit ec7a5b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/include/llvm/Option/ArgList.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class ArgList {
253253
}
254254

255255
/// Return the last argument matching \p Id, or null.
256-
template<typename ...OptSpecifiers>
257-
Arg *getLastArg(OptSpecifiers ...Ids) const {
256+
template <typename... OptSpecifiers>
257+
LLVM_ATTRIBUTE_NOINLINE Arg *getLastArg(OptSpecifiers... Ids) const {
258258
Arg *Res = nullptr;
259259
for (Arg *A : filtered(Ids...)) {
260260
Res = A;
@@ -265,8 +265,8 @@ class ArgList {
265265

266266
/// Return the last argument matching \p Id, or null. Do not "claim" the
267267
/// option (don't mark it as having been used).
268-
template<typename ...OptSpecifiers>
269-
Arg *getLastArgNoClaim(OptSpecifiers ...Ids) const {
268+
template <typename... OptSpecifiers>
269+
LLVM_ATTRIBUTE_NOINLINE Arg *getLastArgNoClaim(OptSpecifiers... Ids) const {
270270
for (Arg *A : filtered_reverse(Ids...))
271271
return A;
272272
return nullptr;

0 commit comments

Comments
 (0)