diff options
Diffstat (limited to 'backend/lib/CodeGen/MachinePeepholeOptimizer.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachinePeepholeOptimizer.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/backend/lib/CodeGen/MachinePeepholeOptimizer.cpp b/backend/lib/CodeGen/MachinePeepholeOptimizer.cpp index 16c935d..ae39334 100644 --- a/backend/lib/CodeGen/MachinePeepholeOptimizer.cpp +++ b/backend/lib/CodeGen/MachinePeepholeOptimizer.cpp @@ -4,13 +4,10 @@ #include "rcc/CodeGen/MachineBasicBlock.h" #include "rcc/CodeGen/MachineFunction.h" -#include "rcc/CodeGen/MachineFunctionCloner.h" #include "rcc/CodeGen/MachineInstr.h" #include "rcc/CodeGen/TargetDescription.h" #include "rcc/CodeGen/TargetInstrInfo.h" -#include <optional> - namespace rcc { namespace { @@ -41,23 +38,7 @@ const MachinePassContract &MachinePeepholeOptimizerPass::contract() const noexce Expected<MachinePassResult> MachinePeepholeOptimizerPass::run(MachineFunction &Function, const TargetDescription &Target, MachineFunctionAnalysisManager &) { - auto Trial = cloneMachineFunction( - Function, Target, - MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); - if (!Trial) { - return std::unexpected( - withErrorContext(Trial.error(), "machine peephole transaction setup failed: ")); - } - auto TrialResult = runImplementation(*Trial->ClonedFunction, Target); - if (!TrialResult) - return std::unexpected(TrialResult.error()); - - auto Result = runImplementation(Function, Target); - if (!Result) { - return std::unexpected(withErrorContext( - Result.error(), "machine peephole diverged after a successful transaction preflight: ")); - } - return Result; + return runImplementation(Function, Target); } Expected<MachinePassResult> |
