[llvm] c503758 - [CodeGen] Use std::pair<MCRegister, Register> to match return from MRI.liveins(). NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 25 15:28:18 PDT 2024
Author: Craig Topper
Date: 2024-08-25T15:28:08-07:00
New Revision: c503758ab6a4eacd3ef671a4a5ccf813995d4456
URL: https://github.com/llvm/llvm-project/commit/c503758ab6a4eacd3ef671a4a5ccf813995d4456
DIFF: https://github.com/llvm/llvm-project/commit/c503758ab6a4eacd3ef671a4a5ccf813995d4456.diff
LOG: [CodeGen] Use std::pair<MCRegister, Register> to match return from MRI.liveins(). NFC
MachineRegisterInfo::liveins returns std::pair<MCRegister, Register>.
Don't convert to std::pair<unsigned, unsigned>.
Added:
Modified:
llvm/lib/CodeGen/MIRPrinter.cpp
llvm/lib/CodeGen/RDFGraph.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
llvm/lib/Target/X86/X86ISelLoweringCall.cpp
llvm/lib/Target/X86/X86VZeroUpper.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 63fb887b09b0d8..6e23969cd99bac 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -329,7 +329,7 @@ void MIRPrinter::convert(yaml::MachineFunction &MF,
}
// Print the live ins.
- for (std::pair<unsigned, unsigned> LI : RegInfo.liveins()) {
+ for (std::pair<MCRegister, Register> LI : RegInfo.liveins()) {
yaml::MachineFunctionLiveIn LiveIn;
printRegMIR(LI.first, LiveIn.Register, TRI);
if (LI.second)
diff --git a/llvm/lib/CodeGen/RDFGraph.cpp b/llvm/lib/CodeGen/RDFGraph.cpp
index ff0fd61078c0b6..bb10b83b256fc4 100644
--- a/llvm/lib/CodeGen/RDFGraph.cpp
+++ b/llvm/lib/CodeGen/RDFGraph.cpp
@@ -913,7 +913,7 @@ void DataFlowGraph::build(const Config &config) {
// Collect function live-ins and entry block live-ins.
MachineBasicBlock &EntryB = *EA.Addr->getCode();
assert(EntryB.pred_empty() && "Function entry block has predecessors");
- for (std::pair<unsigned, unsigned> P : MRI.liveins())
+ for (std::pair<MCRegister, Register> P : MRI.liveins())
LiveIns.insert(RegisterRef(P.first));
if (MRI.tracksLiveness()) {
for (auto I : EntryB.liveins())
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 46c24299d1ae97..09bde54b9aaa5d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -675,7 +675,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
DenseMap<unsigned, unsigned> LiveInMap;
if (!FuncInfo->ArgDbgValues.empty())
- for (std::pair<unsigned, unsigned> LI : RegInfo->liveins())
+ for (std::pair<MCRegister, Register> LI : RegInfo->liveins())
if (LI.second)
LiveInMap.insert(LI);
diff --git a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
index a3159944a2add2..ff444543392687 100644
--- a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
@@ -1162,7 +1162,7 @@ int R600InstrInfo::getIndirectIndexBegin(const MachineFunction &MF) const {
}
const TargetRegisterClass *IndirectRC = getIndirectAddrRegClass();
- for (std::pair<unsigned, unsigned> LI : MRI.liveins()) {
+ for (std::pair<MCRegister, Register> LI : MRI.liveins()) {
Register Reg = LI.first;
if (Reg.isVirtual() || !IndirectRC->contains(Reg))
continue;
diff --git a/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp b/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
index a027f2cedca0a0..ee689ea8d08498 100644
--- a/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
@@ -1287,7 +1287,7 @@ unsigned HexagonEvaluator::getNextPhysReg(unsigned PReg, unsigned Width) const {
}
unsigned HexagonEvaluator::getVirtRegFor(unsigned PReg) const {
- for (std::pair<unsigned,unsigned> P : MRI.liveins())
+ for (std::pair<MCRegister, Register> P : MRI.liveins())
if (P.first == PReg)
return P.second;
return 0;
diff --git a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
index b0158c64c1f383..ab1eeb4111ccdb 100644
--- a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
+++ b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
@@ -1903,7 +1903,7 @@ SDValue X86TargetLowering::LowerFormalArguments(
if (shouldDisableArgRegFromCSR(CallConv) ||
F.hasFnAttribute("no_caller_saved_registers")) {
MachineRegisterInfo &MRI = MF.getRegInfo();
- for (std::pair<Register, Register> Pair : MRI.liveins())
+ for (std::pair<MCRegister, Register> Pair : MRI.liveins())
MRI.disableCalleeSavedRegister(Pair.first);
}
diff --git a/llvm/lib/Target/X86/X86VZeroUpper.cpp b/llvm/lib/Target/X86/X86VZeroUpper.cpp
index 5a3e5efeb402a9..c92167f4c8b34d 100644
--- a/llvm/lib/Target/X86/X86VZeroUpper.cpp
+++ b/llvm/lib/Target/X86/X86VZeroUpper.cpp
@@ -136,7 +136,7 @@ static bool isYmmOrZmmReg(unsigned Reg) {
}
static bool checkFnHasLiveInYmmOrZmm(MachineRegisterInfo &MRI) {
- for (std::pair<unsigned, unsigned> LI : MRI.liveins())
+ for (std::pair<MCRegister, Register> LI : MRI.liveins())
if (isYmmOrZmmReg(LI.first))
return true;
More information about the llvm-commits
mailing list