================
@@ -107,7 +108,18 @@ static bool removeUbsanTraps(Function &F, const 
BlockFrequencyInfo &BFI,
       case Intrinsic::allow_runtime_check: {
         ++NumChecksTotal;
 
-        bool ToRemove = ShouldRemove(BB);
+        bool ToRemove = ShouldRemoveRandom();
+
+        unsigned int cutoff = 0;
+        if (ID == Intrinsic::allow_ubsan_check) {
+          auto *Kind = cast<ConstantInt>(II->getArgOperand(0));
+          if (Kind->getZExtValue() < cutoffs.size())
+            cutoff = cutoffs[Kind->getZExtValue()];
+        }
+        if (HotPercentileCutoff.getNumOccurrences())
----------------
vitalybuka wrote:

No need to lookup array if getNumOccurrences > 0

https://github.com/llvm/llvm-project/pull/124211
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to