[llvm] 8a9a363 - [MIRCanonicalizerPass] Use MCRegister. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 2 23:48:09 PST 2025


Author: Craig Topper
Date: 2025-03-02T23:46:16-08:00
New Revision: 8a9a363ffb96b569a52825d8c2b41ac412f4eb28

URL: https://github.com/llvm/llvm-project/commit/8a9a363ffb96b569a52825d8c2b41ac412f4eb28
DIFF: https://github.com/llvm/llvm-project/commit/8a9a363ffb96b569a52825d8c2b41ac412f4eb28.diff

LOG: [MIRCanonicalizerPass] Use MCRegister. NFC

Added: 
    

Modified: 
    llvm/lib/CodeGen/MIRCanonicalizerPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
index 4be708a6abfad..7c1264e279f66 100644
--- a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
+++ b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
@@ -148,7 +148,7 @@ static bool rescheduleCanonically(unsigned &PseudoIdempotentInstCount,
   std::map<unsigned, MachineInstr *> MultiUserLookup;
   unsigned UseToBringDefCloserToCount = 0;
   std::vector<MachineInstr *> PseudoIdempotentInstructions;
-  std::vector<unsigned> PhysRegDefs;
+  std::vector<MCRegister> PhysRegDefs;
   for (auto *II : Instructions) {
     for (unsigned i = 1; i < II->getNumOperands(); i++) {
       MachineOperand &MO = II->getOperand(i);
@@ -186,7 +186,8 @@ static bool rescheduleCanonically(unsigned &PseudoIdempotentInstCount,
 
       if (II->getOperand(i).isReg()) {
         if (!II->getOperand(i).getReg().isVirtual())
-          if (!llvm::is_contained(PhysRegDefs, II->getOperand(i).getReg())) {
+          if (!llvm::is_contained(PhysRegDefs,
+                                  II->getOperand(i).getReg().asMCReg())) {
             continue;
           }
       }


        


More information about the llvm-commits mailing list