diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-11-08 15:50:55 -0800 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-11-08 17:02:01 -0800 |
commit | b11391bb47d6fb75639c331378440b405e64be7a (patch) | |
tree | e0ea693278d36e4e5db7dd40928986774471ac22 /llvm/lib/AsmParser/LLParser.cpp | |
parent | 1478f36f27cfe06c5da75ef11fab2d409f2beafe (diff) | |
download | bcm5719-llvm-b11391bb47d6fb75639c331378440b405e64be7a.tar.gz bcm5719-llvm-b11391bb47d6fb75639c331378440b405e64be7a.zip |
ThinLTO : Import always_inline functions irrespective of the threshold
Summary: A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.
Patch by Bharathi Seshadri <bseshadr@cisco.com>
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70014
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index c204a9448ce..e9d2dfc195b 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -8248,6 +8248,8 @@ bool LLParser::ParseFlag(unsigned &Val) { /// [',' 'readOnly' ':' Flag]? [',' 'noRecurse' ':' Flag]? /// [',' 'returnDoesNotAlias' ':' Flag]? ')' /// [',' 'noInline' ':' Flag]? ')' +/// [',' 'alwaysInline' ':' Flag]? ')' + bool LLParser::ParseOptionalFFlags(FunctionSummary::FFlags &FFlags) { assert(Lex.getKind() == lltok::kw_funcFlags); Lex.Lex(); @@ -8289,6 +8291,12 @@ bool LLParser::ParseOptionalFFlags(FunctionSummary::FFlags &FFlags) { return true; FFlags.NoInline = Val; break; + case lltok::kw_alwaysInline: + Lex.Lex(); + if (ParseToken(lltok::colon, "expected ':'") || ParseFlag(Val)) + return true; + FFlags.AlwaysInline = Val; + break; default: return Error(Lex.getLoc(), "expected function flag type"); } |