From c63995394de60996ebfe52a47cf2e3a0716d7e3c Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Fri, 24 May 2013 12:26:52 +0000 Subject: Add a new function attribute 'cold' to functions. Other than recognizing the attribute, the patch does little else. It changes the branch probability analyzer so that edges into blocks postdominated by a cold function are given low weight. Added analysis and code generation tests. Added documentation for the new attribute. llvm-svn: 182638 --- llvm/lib/AsmParser/LLParser.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/AsmParser/LLParser.cpp') diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 62d8070d186..b22d251f9e9 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -909,6 +909,7 @@ bool LLParser::ParseFnAttributeValuePairs(AttrBuilder &B, continue; } case lltok::kw_alwaysinline: B.addAttribute(Attribute::AlwaysInline); break; + case lltok::kw_cold: B.addAttribute(Attribute::Cold); break; case lltok::kw_inlinehint: B.addAttribute(Attribute::InlineHint); break; case lltok::kw_minsize: B.addAttribute(Attribute::MinSize); break; case lltok::kw_naked: B.addAttribute(Attribute::Naked); break; @@ -1222,6 +1223,7 @@ bool LLParser::ParseOptionalReturnAttrs(AttrBuilder &B) { case lltok::kw_alignstack: case lltok::kw_alwaysinline: + case lltok::kw_cold: case lltok::kw_inlinehint: case lltok::kw_minsize: case lltok::kw_naked: -- cgit v1.2.3