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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 02:51:09 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Sander de Smalen (sdesmalen-arm)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/209418.diff


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+1-1) 


``````````diff
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");

``````````

</details>


https://github.com/llvm/llvm-project/pull/209418


More information about the llvm-commits mailing list