Skip to content

[BOLT][NFC] Keep input icount for disassembled functions #101091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions bolt/include/bolt/Core/BinaryFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ class BinaryFunction {
/// Original size of the function.
uint64_t Size;

/// Original instruction count of the function, if disassembly succeeded.
uint64_t InputInstructionCount{0};

/// Address of the function in output.
uint64_t OutputAddress{0};

Expand Down Expand Up @@ -2173,6 +2176,9 @@ class BinaryFunction {
/// Get the number of instructions within this function.
uint64_t getInstructionCount() const;

/// Get the original number of instructions.
uint64_t getInputInstructionCount() const { return InputInstructionCount; }

const CFIInstrMapType &getFDEProgram() const { return FrameInstructions; }

void moveRememberRestorePair(BinaryBasicBlock *BB);
Expand Down
2 changes: 2 additions & 0 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,8 @@ Error BinaryFunction::disassemble() {

clearList(Relocations);

InputInstructionCount = Instructions.size();

if (!IsSimple) {
clearList(Instructions);
return createNonFatalBOLTError("");
Expand Down
Loading