[llvm] [OptBisect] Add function filtering support to opt-bisect (PR #222123)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 06:17:31 PDT 2026
================
@@ -86,15 +86,24 @@ static cl::list<std::string> OptDisablePasses(
}),
cl::desc("Optimization pass(es) to disable (comma-separated list)"));
+static cl::list<std::string> OptBisectFuncsList(
+ "opt-bisect-funcs", cl::value_desc("function names"), cl::CommaSeparated,
+ cl::cb<void, std::string>([](const std::string &FuncName) {
+ getOptBisector().setEnabledFunc(FuncName);
+ }),
+ cl::Hidden,
+ cl::desc("Only perform opt bisect for functions that are included in this "
+ "list and if empty, apply to all functions."));
----------------
nikic wrote:
I'm confused, at least in that the option description does not seem to match the implementation?
If you do `-opt-bisect-funcs=foo` what is *supposed* to happen with the non-foo functions? Based on the description, I would have assumed that all optimizations would run as usual for those, as opt-bisect is not applied to them. But from reading your tests, it seems like the behavior is actually the opposite and *all* optimizations for functions not in the list are disabled?
https://github.com/llvm/llvm-project/pull/222123
More information about the llvm-commits
mailing list