[llvm] [SelectionDAG] Switch to LiveRegUnits (PR #84197)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 09:01:50 PST 2024
https://github.com/AtariDreams created https://github.com/llvm/llvm-project/pull/84197
None
>From 0e3fdfc601711b3a4e4ddc9a28ef921d659c1511 Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Wed, 6 Mar 2024 11:59:55 -0500
Subject: [PATCH] [SelectionDAG] Switch to LiveRegUnits
---
llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h | 4 ++--
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
index 85de18f5169e5e..32ff15fc75936a 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
@@ -20,7 +20,7 @@
#include "llvm/ADT/SparseMultiSet.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/identity.h"
-#include "llvm/CodeGen/LivePhysRegs.h"
+#include "llvm/CodeGen/LiveRegUnits.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
@@ -263,7 +263,7 @@ namespace llvm {
MachineInstr *FirstDbgValue = nullptr;
/// Set of live physical registers for updating kill flags.
- LivePhysRegs LiveRegs;
+ LiveRegUnits LiveRegs;
public:
explicit ScheduleDAGInstrs(MachineFunction &mf,
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 0190fa345eb363..75edaef27001d3 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -1103,7 +1103,7 @@ void ScheduleDAGInstrs::reduceHugeMemNodeMaps(Value2SUsMap &stores,
dbgs() << "Loading SUnits:\n"; loads.dump());
}
-static void toggleKills(const MachineRegisterInfo &MRI, LivePhysRegs &LiveRegs,
+static void toggleKills(const MachineRegisterInfo &MRI, LiveRegUnits &LiveRegs,
MachineInstr &MI, bool addToLiveRegs) {
for (MachineOperand &MO : MI.operands()) {
if (!MO.isReg() || !MO.readsReg())
@@ -1113,7 +1113,7 @@ static void toggleKills(const MachineRegisterInfo &MRI, LivePhysRegs &LiveRegs,
continue;
// Things that are available after the instruction are killed by it.
- bool IsKill = LiveRegs.available(MRI, Reg);
+ bool IsKill = LiveRegs.available(Reg);
MO.setIsKill(IsKill);
if (addToLiveRegs)
LiveRegs.addReg(Reg);
@@ -1144,7 +1144,7 @@ void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) {
continue;
LiveRegs.removeReg(Reg);
} else if (MO.isRegMask()) {
- LiveRegs.removeRegsInMask(MO);
+ LiveRegs.removeRegsNotPreserved(MO.getRegMask());
}
}
More information about the llvm-commits
mailing list