Skip to content

Commit a1db9f2

Browse files
committed
[Option] Mark getLastArg(NoClaim) as noinline.
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
1 parent 5cf4959 commit a1db9f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Option/ArgList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class ArgList {
254254

255255
/// Return the last argument matching \p Id, or null.
256256
template<typename ...OptSpecifiers>
257-
Arg *getLastArg(OptSpecifiers ...Ids) const {
257+
LLVM_ATTRIBUTE_NOINLINE Arg * getLastArg(OptSpecifiers ...Ids) const {
258258
Arg *Res = nullptr;
259259
for (Arg *A : filtered(Ids...)) {
260260
Res = A;
@@ -266,7 +266,7 @@ class ArgList {
266266
/// Return the last argument matching \p Id, or null. Do not "claim" the
267267
/// option (don't mark it as having been used).
268268
template<typename ...OptSpecifiers>
269-
Arg *getLastArgNoClaim(OptSpecifiers ...Ids) const {
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)