[llvm] [LLVM] Successor count added to InstCount (PR #171670)
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 12 10:30:32 PST 2025
alinas wrote:
> I think it makes more sense to do this within FunctionPropertiesAnalysis.
>
> https://github.com/llvm/llvm-project/blob/62e00a03fba029f82d421fb3c814a6a02d59b8c8/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h#L91
>
> We already collect some data around successors, so that might cover what you need.
Based on https://github.com/llvm/llvm-project/pull/171658, this change is looking for collecting an additional statistic for LLVM IR structure, beyond instruction count. One the one hand, counting successors doesn't fit in with counting instructions, on the other, adding another analysis pass to the default pipelines (either a new one, or extending FunctionPropertiesAnalysis to expose those counts as statistics) seems like unnecessary overhead.
I can see arguments both ways, but considering this pass is already counting blocks and functions, I'd opt for having this added in as is.
https://github.com/llvm/llvm-project/pull/171670
More information about the llvm-commits
mailing list