[clang] [llvm] [ubsan] Parse and use <cutoffs[0,1,2]=70000;cutoffs[5,6,8]=90000> in LowerAllowCheckPass (PR #124211)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 16:53:53 PST 2025


================
@@ -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;
----------------
thurstond wrote:

Done. I ended up using both BB and II:
```
  auto ShouldRemove = [&](const BasicBlock &BB, const IntrinsicInst *II) {
    unsigned int cutoff = GetCutoff(II);
    return ShouldRemoveRandom() || ShouldRemoveHot(BB, cutoff);
  };
```

https://github.com/llvm/llvm-project/pull/124211


More information about the llvm-commits mailing list