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
// 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;