[llvm] [AArch64] Fixup possibly unused variable warning after #207199 (PR #209418)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 02:50:32 PDT 2026


https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/209418

Using [[maybe_unused]] as the variable is only used in asserts which results in a diagnostic for no-assert builds.

>From 8db4f0411fd128ba45c585fa3b09b934eba6dadb Mon Sep 17 00:00:00 2001
From: Sander de Smalen <sander.desmalen at arm.com>
Date: Tue, 14 Jul 2026 09:45:00 +0000
Subject: [PATCH] [AArch64] Fixup possibly unused variable warning after
 #207199

Using [[maybe_unused]] as the variable is only used in asserts
which results in a diagnostic for no-assert builds.
---
 llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index ffd16b16a4e84..d6f2633297e51 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -5197,8 +5197,8 @@ AArch64TargetLowering::LowerVectorFP_TO_INT_SAT(SDValue Op,
   const EVT DstElementVT = DstVT.getVectorElementType();
   const EVT SatVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
 
+  [[maybe_unused]] const uint64_t DstElementWidth = DstVT.getScalarSizeInBits();
   const uint64_t SrcElementWidth = SrcVT.getScalarSizeInBits();
-  const uint64_t DstElementWidth = DstVT.getScalarSizeInBits();
   const uint64_t SatWidth = SatVT.getScalarSizeInBits();
   assert(SatWidth <= DstElementWidth &&
          "Saturation width cannot exceed result width");



More information about the llvm-commits mailing list