[llvm] b38d472 - [ARM] Prevent converting a virtual register to MCRegister. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 22 22:31:20 PST 2025


Author: Craig Topper
Date: 2025-02-22T22:27:14-08:00
New Revision: b38d4720557846a720ab605fcf158a078ba22df0

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

LOG: [ARM] Prevent converting a virtual register to MCRegister. NFC

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ThumbRegisterInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp b/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp
index 4fe4ed47e0081..911502605c227 100644
--- a/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp
@@ -105,7 +105,7 @@ void ThumbRegisterInfo::emitLoadConstPool(
   MachineFunction &MF = *MBB.getParent();
   const ARMSubtarget &STI = MF.getSubtarget<ARMSubtarget>();
   if (STI.isThumb1Only()) {
-    assert((isARMLowRegister(DestReg) || DestReg.isVirtual()) &&
+    assert((DestReg.isVirtual() || isARMLowRegister(DestReg)) &&
            "Thumb1 does not have ldr to high register");
     return emitThumb1LoadConstPool(MBB, MBBI, dl, DestReg, SubIdx, Val, Pred,
                                    PredReg, MIFlags);


        


More information about the llvm-commits mailing list