diff options
author | Amir Ayupov <aaupov@fb.com> | 2024-07-29 15:23:47 -0700 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2024-07-29 15:23:47 -0700 |
commit | 588c0e28dcccc2f373d083c510a8a52d50bc419c (patch) | |
tree | 56f97905bea456e38821af6bb00679a757beabdf | |
parent | d3ecb16e852d81628d82110402ec0a18d6c6b2ac (diff) | |
download | llvm-users/aaupov/spr/boltnfc-keep-input-icount-for-disassembled-functions.zip llvm-users/aaupov/spr/boltnfc-keep-input-icount-for-disassembled-functions.tar.gz llvm-users/aaupov/spr/boltnfc-keep-input-icount-for-disassembled-functions.tar.bz2 |
[𝘀𝗽𝗿] initial versionusers/aaupov/spr/boltnfc-keep-input-icount-for-disassembled-functions
Created using spr 1.3.4
-rw-r--r-- | bolt/include/bolt/Core/BinaryFunction.h | 6 | ||||
-rw-r--r-- | bolt/lib/Core/BinaryFunction.cpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h index 24c7db2..2c8e239 100644 --- a/bolt/include/bolt/Core/BinaryFunction.h +++ b/bolt/include/bolt/Core/BinaryFunction.h @@ -242,6 +242,9 @@ private: /// 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}; @@ -2173,6 +2176,9 @@ public: /// 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); diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index ea09371..1f5869c 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -1499,6 +1499,8 @@ add_instruction: clearList(Relocations); + InputInstructionCount = Instructions.size(); + if (!IsSimple) { clearList(Instructions); return createNonFatalBOLTError(""); |