Skip to content

Commit e274d5f

Browse files
author
Kai Luo
authored
[MCP] Use MCRegUnit as the key type of CopyTracker::Copies map. NFC. (#98277)
`CopyTracker` is in fact tracking at RegUnit level, not MCRegister.
1 parent cda245a commit e274d5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/CodeGen/MachineCopyPropagation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#include "llvm/CodeGen/TargetRegisterInfo.h"
6666
#include "llvm/CodeGen/TargetSubtargetInfo.h"
6767
#include "llvm/InitializePasses.h"
68+
#include "llvm/MC/MCRegister.h"
6869
#include "llvm/MC/MCRegisterInfo.h"
6970
#include "llvm/Pass.h"
7071
#include "llvm/Support/Debug.h"
@@ -112,7 +113,7 @@ class CopyTracker {
112113
bool Avail;
113114
};
114115

115-
DenseMap<MCRegister, CopyInfo> Copies;
116+
DenseMap<MCRegUnit, CopyInfo> Copies;
116117

117118
public:
118119
/// Mark all of the given registers and their subregisters as unavailable for
@@ -251,7 +252,7 @@ class CopyTracker {
251252
return !Copies.empty();
252253
}
253254

254-
MachineInstr *findCopyForUnit(MCRegister RegUnit,
255+
MachineInstr *findCopyForUnit(MCRegUnit RegUnit,
255256
const TargetRegisterInfo &TRI,
256257
bool MustBeAvailable = false) {
257258
auto CI = Copies.find(RegUnit);
@@ -262,7 +263,7 @@ class CopyTracker {
262263
return CI->second.MI;
263264
}
264265

265-
MachineInstr *findCopyDefViaUnit(MCRegister RegUnit,
266+
MachineInstr *findCopyDefViaUnit(MCRegUnit RegUnit,
266267
const TargetRegisterInfo &TRI) {
267268
auto CI = Copies.find(RegUnit);
268269
if (CI == Copies.end())

0 commit comments

Comments
 (0)