From 6e09614afd2a589690d107b41308f6fe6614c266 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 1 Aug 2026 17:58:12 +0800 Subject: [CodeGen] Add machine function records Represent callee-saved registers, call-site information, called globals, and prefetch targets in the core MachineIR model. Verify target and instruction references and remap StableIDs during explicit function cloning. --- backend/lib/CodeGen/MachineFunctionCloner.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backend/lib/CodeGen/MachineFunctionCloner.cpp') diff --git a/backend/lib/CodeGen/MachineFunctionCloner.cpp b/backend/lib/CodeGen/MachineFunctionCloner.cpp index 971ef3c..aae74ff 100644 --- a/backend/lib/CodeGen/MachineFunctionCloner.cpp +++ b/backend/lib/CodeGen/MachineFunctionCloner.cpp @@ -616,6 +616,10 @@ Expected cloneMachineFunction(const MachineFunction if (!CompilationStatus) return std::unexpected(CompilationStatus.error()); Result.ClonedFunction->compilationStatus() = std::move(*CompilationStatus); + auto Records = Source.records().clone(CloneContext); + if (!Records) + return std::unexpected(Records.error()); + Result.ClonedFunction->records() = std::move(*Records); Result.ClonedFunction->properties() = Source.properties(); Result.ClonedFunction->attributes() = Source.attributes(); auto DestinationVerification = MachineVerifier::verify(*Result.ClonedFunction, Target); -- cgit v1.2.3