Currently prof metadata with branch counts is added only for BranchInst and SwitchInst, but not for IndirectBrInst. As a result, BPI/BFI make incorrect inferences for indirect branches, which can be very hot.
This diff adds metadata for IndirectBrInst, in addition to BranchInst and SwitchInst.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM.
llvm/test/Transforms/SampleProfile/Inputs/pseudo-probe-profile-metadata.prof | ||
---|---|---|
3–6 ↗ | (On Diff #334212) |
Comment Actions
Thanks for the fix, Sergey! Looking forward to more improvements on weight propagation and BFI inference. :) LGTM as well and I will push this one on your behalf.
Comment Actions
prof metadata for indirected branch is supported according to the doc https://llvm.org/docs/BranchWeightMetadata.html, the change fixed an oversight in keeping such metadata. So doc should be good.
clang-format: please reformat the code
3 diff lines are omitted. See full path.