aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/GlobalISel')
-rw-r--r--backend/lib/CodeGen/GlobalISel/Combiner.cpp3
-rw-r--r--backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp15
-rw-r--r--backend/lib/CodeGen/GlobalISel/Legalizer.cpp15
-rw-r--r--backend/lib/CodeGen/GlobalISel/RegBankSelect.cpp15
4 files changed, 0 insertions, 48 deletions
diff --git a/backend/lib/CodeGen/GlobalISel/Combiner.cpp b/backend/lib/CodeGen/GlobalISel/Combiner.cpp
index 6d65a50..08b471a 100644
--- a/backend/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/backend/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -21,9 +21,6 @@ const MachinePassContract &GlobalISelCombinerPass::contract() const noexcept {
Expected<MachinePassResult> GlobalISelCombinerPass::run(MachineFunction &Function,
const TargetDescription &Target,
MachineFunctionAnalysisManager &Analyses) {
- if (!Function.properties().containsAll(contract().Requires))
- return makeUnexpected(ErrorCode::VerificationError,
- "GlobalISel combiner input does not satisfy its stage contract");
auto Trial = cloneMachineFunction(
Function, Target,
MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt});
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<void> 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<MachinePassResult> 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});
diff --git a/backend/lib/CodeGen/GlobalISel/Legalizer.cpp b/backend/lib/CodeGen/GlobalISel/Legalizer.cpp
index 8f3f06f..ca31d56 100644
--- a/backend/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ b/backend/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -177,17 +177,6 @@ private:
return PostOrder;
}
-[[nodiscard]] Expected<void> 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));
@@ -267,10 +256,6 @@ Expected<MachinePassResult> Legalizer::run(MachineFunction &Function,
if (Info == nullptr)
return std::unexpected(
passFailure("legalizer has no target behavior interface", ErrorCode::InvalidArgument));
- auto Required = requireProperties(Function, contract());
- if (!Required)
- return std::unexpected(Required.error());
-
if (AbortMode != GlobalISelAbortMode::Enable) {
if (AbortMode != GlobalISelAbortMode::Disable &&
AbortMode != GlobalISelAbortMode::DisableWithDiagnostic) {
diff --git a/backend/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/backend/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index a5747c3..3b7932b 100644
--- a/backend/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/backend/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -56,17 +56,6 @@ registerConfigurationFingerprint(const MachineRegisterInfo &RegInfo) noexcept {
return Result;
}
-[[nodiscard]] Expected<void> 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]] Expected<void> restoreRegisterConfiguration(
MachineRegisterInfo &RegInfo,
const std::vector<std::pair<Register, std::pair<std::optional<RegisterBankID>,
@@ -299,10 +288,6 @@ Expected<MachinePassResult> RegBankSelect::run(MachineFunction &Function,
if (Info == nullptr)
return std::unexpected(passFailure("register-bank select has no target behavior interface",
ErrorCode::InvalidArgument));
- auto Required = requireProperties(Function, contract());
- if (!Required)
- return std::unexpected(Required.error());
-
MachinePassResult Result;
MachineRegisterInfo &RegInfo = Function.registerInfo();
const std::uint64_t RegisterConfigurationBefore = registerConfigurationFingerprint(RegInfo);