Skip to content

Commit 33f6b28

Browse files
committed
[BOLT] Fix the inaccurate profile data check
1 parent a99c978 commit 33f6b28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bolt/lib/Profile/DataReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ float DataReader::evaluateProfileData(BinaryFunction &BF,
524524
// when we identify tail calls, so they are still represented
525525
// by regular branch instructions and we need isBranch() here.
526526
MCInst *Instr = BF.getInstructionAtOffset(BI.From.Offset);
527+
// If it's a RISCV PseudoCALL - fix it
528+
if (!Instr && BC.isRISCV())
529+
Instr = BF.getInstructionAtOffset(BI.From.Offset + 4);
527530
// If it's a prefix - skip it.
528531
if (Instr && BC.MIB->isPrefix(*Instr))
529532
Instr = BF.getInstructionAtOffset(BI.From.Offset + 1);

0 commit comments

Comments
 (0)