[llvm] [BOLT] Introduce BinaryFunction::canClone() (PR #138771)
Amir Ayupov via llvm-commits
llvm-commits at lists.llvm.org
Tue May 6 18:04:13 PDT 2025
================
@@ -3744,6 +3744,16 @@ void BinaryFunction::postProcessBranches() {
assert(validateCFG() && "invalid CFG");
}
+bool BinaryFunction::canClone() const {
+ // For instrumentation, we need to restrict the execution to the rewritten
+ // version of the function.
+ if (opts::Instrument)
+ return false;
+
+ // Check for the presence of metadata that cannot be duplicated.
+ return !hasEHRanges() && !hasSDTMarker() && !hasPseudoProbe() && !hasORC();
----------------
aaupov wrote:
These checks seem quite restrictive (especially pseudo probes that are supposed to be in every function), what are the functions that can be cloned?
https://github.com/llvm/llvm-project/pull/138771
More information about the llvm-commits
mailing list