mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[BOLT] Fix issue printing CTCs without annotations
Summary: After stripping annotations, conditional tail calls no longer can be identified by their corresponding tag. We can check the number of basic block successors instead. Fixes facebookincubator/BOLT#58. (cherry picked from FBD16444718)
This commit is contained in:
@@ -222,8 +222,9 @@ DynoStats getDynoStats(const BinaryFunction &BF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// CTCs
|
||||
if (BC.MIB->getConditionalTailCall(*CondBranch)) {
|
||||
// CTCs: instruction annotations could be stripped, hence check the number
|
||||
// of successors to identify conditional tail calls.
|
||||
if (BB->succ_size() == 1) {
|
||||
if (BB->branch_info_begin() != BB->branch_info_end())
|
||||
Stats[DynoStats::UNCOND_BRANCHES] += BB->branch_info_begin()->Count;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user