[clang] [clang][dataflow] Drop block-relative cap on worklist iterations. (PR #80033)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 08:54:05 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Yitzhak Mandelbaum (ymand)

<details>
<summary>Changes</summary>

As per the FIXME, this cap never really served its purpose. This patch
simplifies to a single, caller-specified, absolute cap.


---
Full diff: https://github.com/llvm/llvm-project/pull/80033.diff


1 Files Affected:

- (modified) clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp (-8) 


``````````diff
diff --git a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
index 49e425bde66aa..4c88c46142d64 100644
--- a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
+++ b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
@@ -540,14 +540,6 @@ runTypeErasedDataflowAnalysis(
   Worklist.enqueueSuccessors(&Entry);
 
   AnalysisContext AC(CFCtx, Analysis, StartingEnv, BlockStates);
-
-  // FIXME: remove relative cap. There isn't really any good setting for
-  // `MaxAverageVisitsPerBlock`, so it has no clear value over using
-  // `MaxBlockVisits` directly.
-  static constexpr std::int32_t MaxAverageVisitsPerBlock = 4;
-  const std::int32_t RelativeMaxBlockVisits =
-      MaxAverageVisitsPerBlock * BlockStates.size();
-  MaxBlockVisits = std::min(RelativeMaxBlockVisits, MaxBlockVisits);
   std::int32_t BlockVisits = 0;
   while (const CFGBlock *Block = Worklist.dequeue()) {
     LLVM_DEBUG(llvm::dbgs()

``````````

</details>


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


More information about the cfe-commits mailing list