Refactor indirect call promotion profitability analysis (NFC)
authorTeresa Johnson <tejohnson@google.com>
Sun, 17 Jul 2016 14:46:54 +0000 (14:46 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sun, 17 Jul 2016 14:46:54 +0000 (14:46 +0000)
Summary:
Refactored the profitability analysis out of the IC promotion pass and
into lib/Analysis so that it can be accessed by the summary index
builder in a follow-on patch to enable IC promotion in ThinLTO (D21932).

Reviewers: davidxl, xur

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D22182

llvm-svn: 275705

llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp

index 202b94b..1b1761d 100644 (file)
@@ -275,14 +275,6 @@ ICallPromotionFunc::getPromotionCandidatesForCallSite(
     DEBUG(dbgs() << " Candidate " << I << " Count=" << Count
                  << "  Target_func: " << Target << "\n");
 
-    if (ICPInvokeOnly && dyn_cast<CallInst>(Inst)) {
-      DEBUG(dbgs() << " Not promote: User options.\n");
-      break;
-    }
-    if (ICPCallOnly && dyn_cast<InvokeInst>(Inst)) {
-      DEBUG(dbgs() << " Not promote: User option.\n");
-      break;
-    }
     if (ICPCutOff != 0 && NumOfPGOICallPromotion >= ICPCutOff) {
       DEBUG(dbgs() << " Not promote: Cutoff reached.\n");
       break;