summaryrefslogtreecommitdiff
path: root/bolt/lib/Core/BinaryFunctionProfile.cpp
AgeCommit message (Collapse)Author
2025-05-12[BOLT][NFC] Disambiguate sample as basic sample (#139350)Amir Ayupov
Sample is a general term covering both basic (IP) and branch (LBR) profiles. Find and replace ambiguous uses of sample in a basic sample sense. Rename `RawBranchCount` into `RawSampleCount` reflecting its use for both kinds of profile. Rename `PF_LBR` profile type as `PF_BRANCH` reflecting non-LBR based branch profiles (non-brstack SPE, synthesized brstack ETM/PT). Follow-up to #137644. Test Plan: NFC
2024-08-21[BOLT] Improve BinaryFunction::inferFallThroughCounts() (#105450)ShatianWang
This PR improves how basic block execution count is updated when using the BOLT option `-infer-fall-throughs`. Previously, if a 0-count fall-through edge is assigned a positive inferred count N, then the successor block's execution count will be incremented by N. Since the successor's execution count is calculated using information besides inflow sum (such as outflow sum), it likely is already correct, and incrementing it by an additional N would be wrong. This PR improves how the successor's execution count is updated by using the max over its current count and N.
2023-12-11[BOLT] Fix warningsKazu Hirata
This patch fixes: bolt/lib/Core/BinaryFunctionProfile.cpp:222:10: error: variable 'BBMergeSI' set but not used [-Werror,-Wunused-but-set-variable] bolt/lib/Passes/VeneerElimination.cpp:67:12: error: variable 'VeneerCallers' set but not used [-Werror,-Wunused-but-set-variable]
2022-07-30[bolt] Remove redundaunt control-flow statements (NFC)Kazu Hirata
Identified with readability-redundant-control-flow.
2022-06-27[BOLT][NFC] Add aliases for ICP flagsAmir Ayupov
- `indirect-call-promotion` -> `icp` - `indirect-call-promotion-mispredict-threshold` -> `icp-mp-threshold` - `indirect-call-promotion-use-mispredicts` -> `icp-use-mp` - `indirect-call-promotion-topn` -> `icp-topn` - `indirect-call-promotion-calls-topn` -> `icp-calls-topn` - `indirect-call-promotion-jump-tables-topn` -> `icp-jt-topn` - `icp-jump-table-targets` -> `icp-jt-targets` This also fixes an inconsistency in ICP flag names that some start with `indirect-call-promotion` while others start with `icp`. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D128375
2022-06-05[bolt] Remove unneeded cl::ZeroOrMore for cl::opt optionsFangrui Song
2022-05-03[BOLT][NFC] Make ICP options naming uniformAmir Ayupov
Rename `opts::IndirectCallPromotion*` to `opts::ICP*`, making option naming uniform and easier to follow. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124879
2021-12-20[BOLTCore] [NFC] Fix braces usages according to LLVMRafael Auler
Summary: Fix according to Coding Standards doc, section Don't Use Braces on Simple Single-Statement Bodies of if/else/loop Statements. This set of changes applies to lib Core only. (cherry picked from FBD33240028)
2021-12-21[BOLT][NFC] Fix file-description commentsMaksim Panchenko
Summary: Fix comments at the start of source files. (cherry picked from FBD33274597)
2021-12-18[BOLT] Fix profile and tests for nop-removal passMaksim Panchenko
Summary: Since nops are now removed in a separate pass, the profile is consumed on a CFG with nops. If previously a profile was generated without nops, the offsets in the profile could be different if branches included nops either as a source or a destination. This diff adjust offsets to make the profile reading backwards compatible. (cherry picked from FBD33231254)
2021-12-14[BOLT][NFC] Reformat with clang-formatMaksim Panchenko
Summary: Selectively apply clang-format to BOLT code base. (cherry picked from FBD33119052)
2021-10-08Rebase: [NFC] Refactor sources to be buildable in shared modeRafael Auler
Summary: Moves source files into separate components, and make explicit component dependency on each other, so LLVM build system knows how to build BOLT in BUILD_SHARED_LIBS=ON. Please use the -c merge.renamelimit=230 git option when rebasing your work on top of this change. To achieve this, we create a new library to hold core IR files (most classes beginning with Binary in their names), a new library to hold Utils, some command line options shared across both RewriteInstance and core IR files, a new library called Rewrite to hold most classes concerned with running top-level functions coordinating the binary rewriting process, and a new library called Profile to hold classes dealing with profile reading and writing. To remove the dependency from BinaryContext into X86-specific classes, we do some refactoring on the BinaryContext constructor to receive a reference to the specific backend directly from RewriteInstance. Then, the dependency on X86 or AArch64-specific classes is transfered to the Rewrite library. We can't have the Core library depend on targets because targets depend on Core (which would create a cycle). Files implementing the entry point of a tool are transferred to the tools/ folder. All header files are transferred to the include/ folder. The src/ folder was renamed to lib/. (cherry picked from FBD32746834)