diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 19:38:37 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 19:38:37 +0800 |
| commit | 98cae0e8835a1eb8fcb0e43870c04ed934cc51ac (patch) | |
| tree | 3c5b198778900ed13e2bb429b32ae91bff540548 /backend/lib/CodeGen/MachineBranchRelaxation.cpp | |
| parent | 9d1485c0dd4d071e590c18fb8aa02095de3cc830 (diff) | |
| download | rcc-project-98cae0e8835a1eb8fcb0e43870c04ed934cc51ac.tar.gz rcc-project-98cae0e8835a1eb8fcb0e43870c04ed934cc51ac.tar.xz | |
[CodeGen] Match LLVM branch relaxation semantics
Diffstat (limited to 'backend/lib/CodeGen/MachineBranchRelaxation.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineBranchRelaxation.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/backend/lib/CodeGen/MachineBranchRelaxation.cpp b/backend/lib/CodeGen/MachineBranchRelaxation.cpp index 9f14fc4..4df4cc8 100644 --- a/backend/lib/CodeGen/MachineBranchRelaxation.cpp +++ b/backend/lib/CodeGen/MachineBranchRelaxation.cpp @@ -2,7 +2,6 @@ #include "rcc/CodeGen/MachineBranchRelaxation.h" -#include "rcc/CodeGen/LiveVariables.h" #include "rcc/CodeGen/MachineBasicBlock.h" #include "rcc/CodeGen/MachineFunction.h" #include "rcc/CodeGen/MachineFunctionCloner.h" @@ -29,16 +28,12 @@ struct MachineLayout final { [[nodiscard]] const MachinePassContract &relaxationContract() { static const MachinePassContract Contract = [] { MachinePassContract Value{ - .Name = "machine-branch-relaxation", - .Requires = {MachineFunctionProperty::Selected, MachineFunctionProperty::NoPHIs, - MachineFunctionProperty::TiedOpsRewritten, MachineFunctionProperty::NoVRegs, - MachineFunctionProperty::TracksLiveness, - MachineFunctionProperty::FrameFinalized, - MachineFunctionProperty::NoFrameIndices}, + .Name = "branch-relaxation", + .Requires = {MachineFunctionProperty::TracksLiveness}, .Sets = {}, .Clears = {}, .RequiredAnalyses = {}, - .VerificationStage = PipelineStage::PostRAFinalized, + .VerificationStage = std::nullopt, }; Value.ThreadSafety = PassThreadSafety::ThreadSafe; Value.DeclaredChanges = {MachinePassChange::Instructions, MachinePassChange::Operands}; @@ -107,7 +102,7 @@ MachineBranchRelaxationPass::run(MachineFunction &Function, const TargetDescript MachineFunctionAnalysisManager &Analyses) { if (!Function.properties().containsAll(contract().Requires)) { return makeUnexpected(ErrorCode::VerificationError, - "branch relaxation requires finalized frame and tracked liveness"); + "branch relaxation requires tracked liveness"); } auto Trial = cloneMachineFunction( Function, Target, @@ -185,9 +180,6 @@ MachineBranchRelaxationPass::runImplementation(MachineFunction &Function, if (Changed) continue; if (Result.Changed) { - auto Rebuilt = rebuildMachineLiveness(Function, Target); - if (!Rebuilt) - return std::unexpected(Rebuilt.error()); Result.Changes = {MachinePassChange::Instructions, MachinePassChange::Operands}; Result.Preserved = PreservedAnalyses::none(); } else { |
