mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -217,6 +217,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
|
||||
return "uwtable";
|
||||
if (hasAttribute(Attribute::ZExt))
|
||||
return "zeroext";
|
||||
if (hasAttribute(Attribute::Cold))
|
||||
return "cold";
|
||||
|
||||
// FIXME: These should be output like this:
|
||||
//
|
||||
@@ -396,6 +398,7 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
|
||||
case Attribute::SanitizeMemory: return 1ULL << 37;
|
||||
case Attribute::NoBuiltin: return 1ULL << 38;
|
||||
case Attribute::Returned: return 1ULL << 39;
|
||||
case Attribute::Cold: return 1ULL << 40;
|
||||
}
|
||||
llvm_unreachable("Unsupported attribute type");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user