aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineBranchOptimization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/MachineBranchOptimization.cpp')
-rw-r--r--backend/lib/CodeGen/MachineBranchOptimization.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/backend/lib/CodeGen/MachineBranchOptimization.cpp b/backend/lib/CodeGen/MachineBranchOptimization.cpp
index e03b0d9..6e3bc17 100644
--- a/backend/lib/CodeGen/MachineBranchOptimization.cpp
+++ b/backend/lib/CodeGen/MachineBranchOptimization.cpp
@@ -8,7 +8,6 @@
#include "rcc/CodeGen/MachineBasicBlockAttributes.h"
#include "rcc/CodeGen/MachineCFGUpdater.h"
#include "rcc/CodeGen/MachineFunction.h"
-#include "rcc/CodeGen/MachineFunctionCloner.h"
#include "rcc/CodeGen/MachineFunctionRecords.h"
#include "rcc/CodeGen/MachineInstr.h"
#include "rcc/CodeGen/MachineJumpTableInfo.h"
@@ -21,7 +20,6 @@
#include <algorithm>
#include <cstddef>
#include <cstdint>
-#include <optional>
#include <ranges>
#include <string>
#include <unordered_set>
@@ -581,22 +579,7 @@ const MachinePassContract &MachineBranchOptimizationPass::contract() const noexc
Expected<MachinePassResult> MachineBranchOptimizationPass::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(), "branch optimization 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(), "branch optimization diverged after a successful transaction preflight: "));
- }
- return Result;
+ return runImplementation(Function, Target);
}
Expected<MachinePassResult>