[llvm] 76abef6 - [CodeGen] Remove an unnecessary cast (NFC) (#151901)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 07:40:14 PDT 2025


Author: Kazu Hirata
Date: 2025-08-04T07:40:10-07:00
New Revision: 76abef60b0d7adb9996220894e4390a93cf9bc1c

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

LOG: [CodeGen] Remove an unnecessary cast (NFC) (#151901)

getOpcode() already returns unsigned.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TargetInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index 705e046ed3457..9e49dddd46ba6 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -993,7 +993,7 @@ static bool canCombine(MachineBasicBlock &MBB, MachineOperand &MO,
     MI = MRI.getUniqueVRegDef(MO.getReg());
   // And it needs to be in the trace (otherwise, it won't have a depth).
   if (!MI || MI->getParent() != &MBB ||
-      ((unsigned)MI->getOpcode() != CombineOpc && CombineOpc != 0))
+      (MI->getOpcode() != CombineOpc && CombineOpc != 0))
     return false;
   // Must only used by the user we combine with.
   if (!MRI.hasOneNonDBGUse(MI->getOperand(0).getReg()))


        


More information about the llvm-commits mailing list