Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bolt/lib/Profile/DataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ float DataReader::evaluateProfileData(BinaryFunction &BF,
// when we identify tail calls, so they are still represented
// by regular branch instructions and we need isBranch() here.
MCInst *Instr = BF.getInstructionAtOffset(BI.From.Offset);
// If it's a RISCV PseudoCALL - fix it
if (!Instr && BC.isRISCV())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use isRISCVCall(const MCInst &First, const MCInst &Second)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCInst *Instr = BF.getInstructionAtOffset(BI.From.Offset);
But if this method is used, the first instruction will return nullptr, and the second instruction can correctly obtain jalr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaupov Could you please review the new changes?

Instr = BF.getInstructionAtOffset(BI.From.Offset + 4);
// If it's a prefix - skip it.
if (Instr && BC.MIB->isPrefix(*Instr))
Instr = BF.getInstructionAtOffset(BI.From.Offset + 1);
Expand Down
Loading