[llvm] [ModuleSummary] Avoid redundant domtree/BFI computations (PR #176646)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 19 05:15:58 PST 2026


teresajohnson wrote:

> Based on [aengelke at c73cec8](https://github.com/aengelke/llvm-project/commit/c73cec84c99e5a63dca961fef67998a677c53a3c), I think the use of BFI in the absence of profiling data might be intentional?

Yes this is the same as https://reviews.llvm.org/D42212 that I mentioned in my comment. After some investigation, since it looks like this isn't in active use, I think it should be reverted. @aengelke it would probably be cleaner to rip that out before we make this change, to avoid confusion on that test. If you don't have a chance to do it I can send a PR sometime this week.

> 
> But even if we do want to always compute BFI, the current code is sub-optimal, because https://github.com/aengelke/llvm-project/blob/9d2f77a529d4dfadccf4b0c9f600587eed73ff78/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp#L1061 unconditionally computes the DT, even though the BFI calculation also need it. If we're fetching BFI from FAM we should be fetching DT as well.

Good call. Yes, this should presumably also change to having a callback to get this from the FAM via DominatorTreeAnalysis.

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


More information about the llvm-commits mailing list