[llvm] 20362c5 - [TwoAddressInstructionPass] Use Register. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 2 12:56:32 PST 2025


Author: Craig Topper
Date: 2025-03-02T12:44:25-08:00
New Revision: 20362c51dd94a1dfbf1c7e8327a9b6280609c572

URL: https://github.com/llvm/llvm-project/commit/20362c51dd94a1dfbf1c7e8327a9b6280609c572
DIFF: https://github.com/llvm/llvm-project/commit/20362c51dd94a1dfbf1c7e8327a9b6280609c572.diff

LOG: [TwoAddressInstructionPass] Use Register. NFC

Added: 
    

Modified: 
    llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 6236268f77ab1..2ea99e332cbda 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -181,7 +181,7 @@ class TwoAddressInstructionImpl {
   void processCopy(MachineInstr *MI);
 
   using TiedPairList = SmallVector<std::pair<unsigned, unsigned>, 4>;
-  using TiedOperandMap = SmallDenseMap<unsigned, TiedPairList>;
+  using TiedOperandMap = SmallDenseMap<Register, TiedPairList>;
 
   bool collectTiedOperands(MachineInstr *MI, TiedOperandMap&);
   void processTiedPairs(MachineInstr *MI, TiedPairList&, unsigned &Dist);
@@ -624,7 +624,7 @@ void TwoAddressInstructionImpl::removeClobberedSrcRegMap(MachineInstr *MI) {
 // Returns true if Reg is equal or aliased to at least one register in Set.
 bool TwoAddressInstructionImpl::regOverlapsSet(
     const SmallVectorImpl<Register> &Set, Register Reg) const {
-  for (unsigned R : Set)
+  for (Register R : Set)
     if (TRI->regsOverlap(R, Reg))
       return true;
 
@@ -854,10 +854,10 @@ void TwoAddressInstructionImpl::scanUses(Register DstReg) {
   }
 
   if (!VirtRegPairs.empty()) {
-    unsigned ToReg = VirtRegPairs.back();
+    Register ToReg = VirtRegPairs.back();
     VirtRegPairs.pop_back();
     while (!VirtRegPairs.empty()) {
-      unsigned FromReg = VirtRegPairs.pop_back_val();
+      Register FromReg = VirtRegPairs.pop_back_val();
       bool isNew = DstRegMap.insert(std::make_pair(FromReg, ToReg)).second;
       if (!isNew)
         assert(DstRegMap[FromReg] == ToReg &&"Can't map to two dst registers!");
@@ -1562,7 +1562,7 @@ void TwoAddressInstructionImpl::processTiedPairs(MachineInstr *MI,
 
   bool RemovedKillFlag = false;
   bool AllUsesCopied = true;
-  unsigned LastCopiedReg = 0;
+  Register LastCopiedReg;
   SlotIndex LastCopyIdx;
   Register RegB = 0;
   unsigned SubRegB = 0;


        


More information about the llvm-commits mailing list