[llvm] [BOLT] Allow getNewFunctionOrDataAddress to map addrs inside functions (PR #117766)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 14:14:34 PST 2024


================
@@ -5569,14 +5569,10 @@ uint64_t RewriteInstance::getNewFunctionOrDataAddress(uint64_t OldAddress) {
   if (const BinaryFunction *BF =
           BC->getBinaryFunctionContainingAddress(OldAddress)) {
     if (BF->isEmitted()) {
-      // If OldAddress is the another entry point of
-      // the function, then BOLT could get the new address.
-      if (BF->isMultiEntry()) {
-        for (const BinaryBasicBlock &BB : *BF)
-          if (BB.isEntryPoint() &&
-              (BF->getAddress() + BB.getOffset()) == OldAddress)
-            return BF->getOutputAddress() + BB.getOffset();
----------------
aaupov wrote:

This code was likely incorrect/occasionally correct: `BB.getOffset()` returns input offset.

https://github.com/llvm/llvm-project/pull/117766


More information about the llvm-commits mailing list