Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.

Commit 3d677cf

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359253 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 784e7cf commit 3d677cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Transforms/IPO/GlobalOpt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,8 +2289,8 @@ OptimizeFunctions(Module &M, TargetLibraryInfo *TLI,
22892289
// cold at all call sites and the callers contain no other non coldcc
22902290
// calls.
22912291
if (EnableColdCCStressTest ||
2292-
(isValidCandidateForColdCC(*F, GetBFI, AllCallsCold) &&
2293-
TTI.useColdCCForColdCall(*F))) {
2292+
(TTI.useColdCCForColdCall(*F) &&
2293+
isValidCandidateForColdCC(*F, GetBFI, AllCallsCold))) {
22942294
F->setCallingConv(CallingConv::Cold);
22952295
changeCallSitesToColdCC(F);
22962296
Changed = true;

0 commit comments

Comments
 (0)