]> granicus.if.org Git - llvm/commitdiff
Address review comments.
authorTeresa Johnson <tejohnson@google.com>
Sun, 17 Jul 2016 14:46:58 +0000 (14:46 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sun, 17 Jul 2016 14:46:58 +0000 (14:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275706 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/IndirectCallPromotion.cpp

index 1b1761d619fd71b3999cad950f4a057da1ba981d..202b94b19c4ca0fa3c1ab8b3e47de682558e2894 100644 (file)
@@ -275,6 +275,14 @@ 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;