diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-27 15:53:10 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-27 15:53:10 +0800 |
| commit | b7cb5381e520a25e8f0f465903d8eea1972761c2 (patch) | |
| tree | db2c30c677ed8eec20f0f4e37d6387fa05cc6a6b /backend/lib/CodeGen/MachineLICM.cpp | |
| parent | a932de71457e16030d7d05e4230c56e231c7a8e9 (diff) | |
| download | rcc-project-b7cb5381e520a25e8f0f465903d8eea1972761c2.tar.gz rcc-project-b7cb5381e520a25e8f0f465903d8eea1972761c2.tar.xz | |
[CodeGen] Run machine optimizations once
Diffstat (limited to 'backend/lib/CodeGen/MachineLICM.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineLICM.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/backend/lib/CodeGen/MachineLICM.cpp b/backend/lib/CodeGen/MachineLICM.cpp index 6d76d5d..6ab15dc 100644 --- a/backend/lib/CodeGen/MachineLICM.cpp +++ b/backend/lib/CodeGen/MachineLICM.cpp @@ -7,7 +7,6 @@ #include "rcc/CodeGen/MachineAnalyses.h" #include "rcc/CodeGen/MachineBasicBlock.h" #include "rcc/CodeGen/MachineFunction.h" -#include "rcc/CodeGen/MachineFunctionCloner.h" #include "rcc/CodeGen/MachineInstr.h" #include "rcc/CodeGen/MachineOperand.h" #include "rcc/CodeGen/MachineRegisterInfo.h" @@ -321,24 +320,7 @@ const MachinePassContract &MachineLICMPass::contract() const noexcept { Expected<MachinePassResult> MachineLICMPass::run(MachineFunction &Function, const TargetDescription &Target, MachineFunctionAnalysisManager &Analyses) { - auto Trial = cloneMachineFunction( - Function, Target, - MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); - if (!Trial) { - return std::unexpected( - withErrorContext(Trial.error(), "machine LICM transaction setup failed: ")); - } - MachineFunctionAnalysisManager TrialAnalyses; - auto TrialResult = runImplementation(*Trial->ClonedFunction, Target, TrialAnalyses); - if (!TrialResult) - return std::unexpected(TrialResult.error()); - - auto Result = runImplementation(Function, Target, Analyses); - if (!Result) { - return std::unexpected(withErrorContext( - Result.error(), "machine LICM diverged after a successful transaction preflight: ")); - } - return Result; + return runImplementation(Function, Target, Analyses); } Expected<MachinePassResult> |
