Skip to content

Commit

Permalink
RegisterCoalescer: Remove unnecessary maybe_unused
Browse files Browse the repository at this point in the history
2214026 didn't fix an unused variable
warning correctly.
  • Loading branch information
arsenm committed Jun 6, 2024
1 parent ac5e278 commit 5be0d00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/RegisterCoalescer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5be0d00

Please sign in to comment.