diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-11-13 01:44:32 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-11-13 01:44:32 +0000 |
commit | 5af7ace4ee9397fe9e1738a144b196fd23868cef (patch) | |
tree | c98b569b0836eabbe96ec20661dffdd5a6e15688 /llvm/lib/Analysis | |
parent | 560a5faab099c45cead32faf03c825c30ff1e9c8 (diff) | |
download | bcm5719-llvm-5af7ace4ee9397fe9e1738a144b196fd23868cef.tar.gz bcm5719-llvm-5af7ace4ee9397fe9e1738a144b196fd23868cef.zip |
Revert r252990.
Some of the buildbots are still failing.
llvm-svn: 252999
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index b90843494b6..26f2e7ff504 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -1349,13 +1349,22 @@ InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, int Threshold) { return getInlineCost(CS, CS.getCalledFunction(), Threshold); } +/// \brief Test that two functions either have or have not the given attribute +/// at the same time. +template<typename AttrKind> +static bool attributeMatches(Function *F1, Function *F2, AttrKind Attr) { + return F1->getFnAttribute(Attr) == F2->getFnAttribute(Attr); +} + /// \brief Test that there are no attribute conflicts between Caller and Callee /// that prevent inlining. static bool functionsHaveCompatibleAttributes(Function *Caller, Function *Callee, TargetTransformInfo &TTI) { return TTI.areInlineCompatible(Caller, Callee) && - AttributeFuncs::areInlineCompatible(*Caller, *Callee); + attributeMatches(Caller, Callee, Attribute::SanitizeAddress) && + attributeMatches(Caller, Callee, Attribute::SanitizeMemory) && + attributeMatches(Caller, Callee, Attribute::SanitizeThread); } InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, Function *Callee, |