[llvm] [OpenMPOpt] Bound the if-cascade built for an indirect call (PR #217098)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 03:12:29 PDT 2026


================
@@ -114,6 +114,14 @@ static cl::opt<bool> DisableOpenMPOptStateMachineRewrite(
     cl::desc("Disable OpenMP optimizations that replace the state machine."),
     cl::Hidden, cl::init(false));
 
+static cl::opt<unsigned> MaxIndirectCallSpecializations(
+    "openmp-opt-max-indirect-call-specializations",
+    cl::desc("Do not turn an indirect call into an if-cascade of direct calls "
+             "when more than this many callees are possible (0 disables the "
+             "if-cascade; a call site with a single known callee is still "
+             "promoted)."),
+    cl::Hidden, cl::init(3));
----------------
arsenm wrote:

Probably shouldn't have a cl::opt for this. We should have a concrete need for them, not just in case 

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


More information about the llvm-commits mailing list