aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 13:45:07 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 13:45:07 +0800
commite72ad2cd524ff38f162a23d69da5f78494d337ae (patch)
tree2e590806b0f610e4392f25f6e8cdff57d2f5a929 /backend/lib/CodeGen/MachineScheduler.cpp
parent3b14bd4d5324b5a280c1ee5567b5526b59e60c5b (diff)
downloadrcc-project-e72ad2cd524ff38f162a23d69da5f78494d337ae.tar.gz
rcc-project-e72ad2cd524ff38f162a23d69da5f78494d337ae.tar.xz
[CodeGen] Centralize machine instruction erasure
Diffstat (limited to 'backend/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--backend/lib/CodeGen/MachineScheduler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/lib/CodeGen/MachineScheduler.cpp b/backend/lib/CodeGen/MachineScheduler.cpp
index dfc7b24..65f1e01 100644
--- a/backend/lib/CodeGen/MachineScheduler.cpp
+++ b/backend/lib/CodeGen/MachineScheduler.cpp
@@ -302,7 +302,7 @@ scheduleRegion(MachineBasicBlock &Block, std::span<MachineInstr *const> Instruct
MachineInstr *Anchor = Instructions.back()->next();
for (MachineInstr *Instruction : Instructions) {
- auto Removed = Block.removeInstruction(*Instruction);
+ auto Removed = Instruction->eraseFromParent();
if (!Removed)
return std::unexpected(Removed.error());
}
@@ -323,8 +323,7 @@ runMachineScheduler(MachineFunction &Function, const TargetDescription &Target,
const TargetSchedulingModel &Model, ScheduleDAGMode Mode,
const LiveVariablesAnalysis::Result &Liveness,
const MachineBlockFrequencyAnalysis::Result &Frequencies,
- MachineSchedulerOptions Options,
- MachineFunctionAnalysisManager &Analyses) {
+ MachineSchedulerOptions Options, MachineFunctionAnalysisManager &Analyses) {
if (Options.MaximumRegionSize == 0) {
return makeUnexpected(ErrorCode::InvalidArgument,
"machine scheduler region budget must be nonzero");