From a72a7a4323fb6eef8e15cc2f1229bcca14879e94 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 26 Aug 2026 23:28:39 +0800 Subject: [CodeGen] Centralize machine pass property validation --- backend/lib/CodeGen/TwoAddressInstructionPass.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'backend/lib/CodeGen/TwoAddressInstructionPass.cpp') diff --git a/backend/lib/CodeGen/TwoAddressInstructionPass.cpp b/backend/lib/CodeGen/TwoAddressInstructionPass.cpp index b9e1443..b0b7e5b 100644 --- a/backend/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/backend/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -32,15 +32,6 @@ struct RegisterValue final { std::uint32_t TargetFlags = 0; }; -[[nodiscard]] Expected requireProperties(const MachineFunction &Function, - const MachinePassContract &Contract) { - const MachineFunctionProperties Missing = Contract.Requires.missingFrom(Function.properties()); - if (Missing.empty()) - return {}; - return makeUnexpected(ErrorCode::VerificationError, - Contract.Name + " requires properties: " + Missing.toString()); -} - [[nodiscard]] RegisterOperandFlags generatedDefFlags(RegisterOperandFlags Original) noexcept { RegisterOperandFlags Result; if (Original.has(RegisterOperandFlag::Undef)) @@ -457,10 +448,6 @@ const MachinePassContract &TwoAddressInstructionPass::contract() const noexcept Expected TwoAddressInstructionPass::run(MachineFunction &Function, const TargetDescription &Target, MachineFunctionAnalysisManager &Analyses) { - auto Required = requireProperties(Function, contract()); - if (!Required) - return std::unexpected(Required.error()); - auto Trial = cloneMachineFunction( Function, Target, MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); -- cgit v1.2.3