[llvm] 2214026 - [CodeGen] Fix -Wunused-variable in RegisterCoalescer.cpp (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 03:39:45 PDT 2023
Author: Jie Fu
Date: 2023-10-02T18:38:45+08:00
New Revision: 2214026e957397cc6385f778b28d570485a31856
URL: https://github.com/llvm/llvm-project/commit/2214026e957397cc6385f778b28d570485a31856
DIFF: https://github.com/llvm/llvm-project/commit/2214026e957397cc6385f778b28d570485a31856.diff
LOG: [CodeGen] Fix -Wunused-variable in RegisterCoalescer.cpp (NFC)
/llvm-project/llvm/lib/CodeGen/RegisterCoalescer.cpp:1320:18: error: unused variable 'DefSubIdx' [-Werror,-Wunused-variable]
const unsigned DefSubIdx = DefMI->getOperand(0).getSubReg();
^
1 error generated.
Added:
Modified:
llvm/lib/CodeGen/RegisterCoalescer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 53bc7de8b388651..9410944705c1c89 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -1317,7 +1317,7 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
if (SrcIdx && DstIdx)
return false;
- const unsigned DefSubIdx = DefMI->getOperand(0).getSubReg();
+ [[maybe_unused]] const unsigned DefSubIdx = DefMI->getOperand(0).getSubReg();
const TargetRegisterClass *DefRC = TII->getRegClass(MCID, 0, TRI, *MF);
if (!DefMI->isImplicitDef()) {
if (DstReg.isPhysical()) {
More information about the llvm-commits
mailing list