diff options
author | Justin Bogner <mail@justinbogner.com> | 2019-04-26 00:12:50 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2019-04-26 00:12:50 +0000 |
commit | df5d2b3846d9aecd36a943ada5be215b86db5d99 (patch) | |
tree | cd97a1677c0c31d747bab23ae74c1e73040c1c8d /llvm/lib/Transforms | |
parent | 4f71049a39dc7ebbb957dc701f77cd6191b20e3c (diff) | |
download | bcm5719-llvm-df5d2b3846d9aecd36a943ada5be215b86db5d99.tar.gz bcm5719-llvm-df5d2b3846d9aecd36a943ada5be215b86db5d99.zip |
[GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check
isValidCandidateForColdCC is much more expensive than
TTI.useColdCCForColdCall, which by default just returns false. Avoid
doing this work if we're not going to look at the answer anyway.
This change is NFC, but I see significant compile time improvements on
some code with pathologically many functions.
llvm-svn: 359253
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index c89541dc732..a304d4e2dd9 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2295,8 +2295,8 @@ OptimizeFunctions(Module &M, TargetLibraryInfo *TLI, // cold at all call sites and the callers contain no other non coldcc // calls. if (EnableColdCCStressTest || - (isValidCandidateForColdCC(*F, GetBFI, AllCallsCold) && - TTI.useColdCCForColdCall(*F))) { + (TTI.useColdCCForColdCall(*F) && + isValidCandidateForColdCC(*F, GetBFI, AllCallsCold))) { F->setCallingConv(CallingConv::Cold); changeCallSitesToColdCC(F); Changed = true; |