Some indirect branches that are important for performance might not
be promoted because there are too many targets and/or they don't have enough
counts to be promoted. Let's make them easier to understand by adding
diagnostics for such opportunities.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Added a test and fixed some minor issues that I found while adding the test.
ICallPromotionAnalysis::getPromotionCandidatesForInstruction used to return only MaxNumPromotions targets even when there are more number of targets. So, added MaxNumTargets to set that number separately.
The desired coverage should be (100 - ICPMissingPercentThreshold) and not ICPMissingPercentThreshold.
Added a test. PTAL.
llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp | ||
---|---|---|
373 | Could you clarify this comment in a little more detail? Do you suggest changing the interface of ICallAnalysis.getPromotionCandidatesForInstruction() so that it could also exposed RemainingCount next to TotalCount? I don't see how it could be moved to line 412. | |
380 | Done. |
How about move this ilne to line 412 to ICallPromotionAnalysis? I think that's a better place for this.