[llvm] 5be0d00 - RegisterCoalescer: Remove unnecessary maybe_unused

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 08:15:25 PDT 2024


Author: Matt Arsenault
Date: 2024-06-06T17:15:20+02:00
New Revision: 5be0d00daa5737b6d2165d0c3ec29ce8af068053

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

LOG: RegisterCoalescer: Remove unnecessary maybe_unused

2214026e957397cc6385f778b28d570485a31856 didn't fix an unused variable
warning correctly.

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegisterCoalescer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 3397bd0a6060..a808a541103f 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -1339,14 +1339,13 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
   if (SrcIdx && DstIdx)
     return false;
 
-  [[maybe_unused]] const unsigned DefSubIdx = DefMI->getOperand(0).getSubReg();
+  const unsigned DefSubIdx = DefMI->getOperand(0).getSubReg();
   const TargetRegisterClass *DefRC = TII->getRegClass(MCID, 0, TRI, *MF);
   if (!DefMI->isImplicitDef()) {
     if (DstReg.isPhysical()) {
       Register NewDstReg = DstReg;
 
-      unsigned NewDstIdx = TRI->composeSubRegIndices(CP.getSrcIdx(),
-                                              DefMI->getOperand(0).getSubReg());
+      unsigned NewDstIdx = TRI->composeSubRegIndices(CP.getSrcIdx(), DefSubIdx);
       if (NewDstIdx)
         NewDstReg = TRI->getSubReg(DstReg, NewDstIdx);
 


        


More information about the llvm-commits mailing list