aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2023-06-16 11:01:29 +0100
committerJay Foad <jay.foad@amd.com>2023-06-16 12:21:32 +0100
commitda7892f7295f31b46486418e2abf15334db96cbb (patch)
tree3dabac0c19ffa9680f3eb5e7f565d2f96d3f3659 /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parent7ae49609fdb4e4a66fa3e97f5b709f7bec720bb8 (diff)
downloadllvm-da7892f7295f31b46486418e2abf15334db96cbb.zip
llvm-da7892f7295f31b46486418e2abf15334db96cbb.tar.gz
llvm-da7892f7295f31b46486418e2abf15334db96cbb.tar.bz2
[MC] Use regunits instead of MCRegUnitIterator. NFC.
Differential Revision: https://reviews.llvm.org/D153122
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index d443b89..26110a1 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -228,16 +228,16 @@ public:
return nullptr;
if (CI->second.DefRegs.size() != 1)
return nullptr;
- MCRegUnitIterator RUI(CI->second.DefRegs[0], &TRI);
- return findCopyForUnit(*RUI, TRI, true);
+ MCRegUnit RU = *TRI.regunits(CI->second.DefRegs[0]).begin();
+ return findCopyForUnit(RU, TRI, true);
}
MachineInstr *findAvailBackwardCopy(MachineInstr &I, MCRegister Reg,
const TargetRegisterInfo &TRI,
const TargetInstrInfo &TII,
bool UseCopyInstr) {
- MCRegUnitIterator RUI(Reg, &TRI);
- MachineInstr *AvailCopy = findCopyDefViaUnit(*RUI, TRI);
+ MCRegUnit RU = *TRI.regunits(Reg).begin();
+ MachineInstr *AvailCopy = findCopyDefViaUnit(RU, TRI);
if (!AvailCopy)
return nullptr;
@@ -265,9 +265,9 @@ public:
const TargetInstrInfo &TII, bool UseCopyInstr) {
// We check the first RegUnit here, since we'll only be interested in the
// copy if it copies the entire register anyway.
- MCRegUnitIterator RUI(Reg, &TRI);
+ MCRegUnit RU = *TRI.regunits(Reg).begin();
MachineInstr *AvailCopy =
- findCopyForUnit(*RUI, TRI, /*MustBeAvailable=*/true);
+ findCopyForUnit(RU, TRI, /*MustBeAvailable=*/true);
if (!AvailCopy)
return nullptr;
@@ -297,8 +297,8 @@ public:
const TargetRegisterInfo &TRI,
const TargetInstrInfo &TII,
bool UseCopyInstr) {
- MCRegUnitIterator RUI(Reg, &TRI);
- auto CI = Copies.find(*RUI);
+ MCRegUnit RU = *TRI.regunits(Reg).begin();
+ auto CI = Copies.find(RU);
if (CI == Copies.end() || !CI->second.Avail)
return nullptr;
@@ -326,8 +326,8 @@ public:
// Find last COPY that uses Reg.
MachineInstr *findLastSeenUseInCopy(MCRegister Reg,
const TargetRegisterInfo &TRI) {
- MCRegUnitIterator RUI(Reg, &TRI);
- auto CI = Copies.find(*RUI);
+ MCRegUnit RU = *TRI.regunits(Reg).begin();
+ auto CI = Copies.find(RU);
if (CI == Copies.end())
return nullptr;
return CI->second.LastSeenUseInCopy;