[llvm-branch-commits] [BOLT][NFCI] Allow non-simple functions to be in disassembled state (PR #90806)

2024-05-08 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/90806
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Allow non-simple functions to be in disassembled state (PR #90806)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov converted_to_draft 
https://github.com/llvm/llvm-project/pull/90806
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Allow non-simple functions to be in disassembled state (PR #90806)

2024-05-01 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/90806
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Allow non-simple functions to be in disassembled state (PR #90806)

2024-05-01 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)


Changes

BOLTed binaries have no relocations, thus all split functions are marked
as non-simple (BinaryContext::registerFragment). In turn, this prevents
them from being disassembled. Relax the restriction to allow instruction
lookups.

Test Plan: NFC


---
Full diff: https://github.com/llvm/llvm-project/pull/90806.diff


2 Files Affected:

- (modified) bolt/lib/Core/BinaryFunction.cpp (-5) 
- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+2-1) 


``diff
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index fff53dd25004a4..8b12492aa1a134 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -1437,11 +1437,6 @@ Error BinaryFunction::disassemble() {
 
   clearList(Relocations);
 
-  if (!IsSimple) {
-clearList(Instructions);
-return createNonFatalBOLTError("");
-  }
-
   updateState(State::Disassembled);
 
   return Error::success();
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp 
b/bolt/lib/Rewrite/RewriteInstance.cpp
index 23f79e3c135a78..f6f597c8cee0d8 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -3343,7 +3343,8 @@ void RewriteInstance::disassembleFunctions() {
 
 if (!Function.isSimple()) {
   assert((!BC->HasRelocations || Function.getSize() == 0 ||
-  Function.hasIndirectTargetToSplitFragment()) &&
+  Function.hasIndirectTargetToSplitFragment() ||
+  Function.hasInternalCalls()) &&
  "unexpected non-simple function in relocation mode");
   continue;
 }

``




https://github.com/llvm/llvm-project/pull/90806
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Allow non-simple functions to be in disassembled state (PR #90806)

2024-05-01 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/90806

BOLTed binaries have no relocations, thus all split functions are marked
as non-simple (BinaryContext::registerFragment). In turn, this prevents
them from being disassembled. Relax the restriction to allow instruction
lookups.

Test Plan: NFC



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits