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/GlobalISel/InstructionSelect.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp') diff --git a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 995a9a0..66bbff2 100644 --- a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -152,17 +152,6 @@ void combineFingerprint(std::uint64_t &State, std::uint64_t Value) noexcept { return Result; } -[[nodiscard]] Expected requireProperties(const MachineFunction &Function, - const MachinePassContract &Contract) { - const MachineFunctionProperties Missing = Contract.Requires.missingFrom(Function.properties()); - if (!Missing.empty()) { - return makeUnexpected(ErrorCode::VerificationError, - "pass '" + Contract.Name + - "' requires properties: " + Missing.toString()); - } - return {}; -} - [[nodiscard]] Error passFailure(std::string Message, ErrorCode Code = ErrorCode::VerificationError) { return Error(Code, std::move(Message)); @@ -225,10 +214,6 @@ Expected InstructionSelect::run(MachineFunction &Function, if (Info == nullptr) return std::unexpected(passFailure("instruction select has no target behavior interface", ErrorCode::InvalidArgument)); - 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