[llvm] [AArch64] Mark a variable as maybe unused. NFC. (PR #159344)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 05:23:53 PDT 2025


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/159344

This avoids the following warning if building with asserts disabled:

    ../lib/Target/AArch64/AArch64ISelLowering.cpp:19079:7: warning: unused variable 'VT' [-Wunused-variable]
     19079 |   MVT VT = N->getSimpleValueType(0);
           |       ^~

>From f82ff12b93b8885b7a6782b05e7e2431571cd55a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 17 Sep 2025 15:22:06 +0300
Subject: [PATCH] [AArch64] Mark a variable as maybe unused. NFC.

This avoids the following warning if building with asserts disabled:

    ../lib/Target/AArch64/AArch64ISelLowering.cpp:19079:7: warning: unused variable 'VT' [-Wunused-variable]
     19079 |   MVT VT = N->getSimpleValueType(0);
           |       ^~
---
 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 0ca5e89263b72..f516381b95ff6 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -19076,7 +19076,7 @@ static SDValue performUADDVCombine(SDNode *N, SelectionDAG &DAG) {
   }
 
   // uaddv(A) --> A if all lanes of A are known to be zeros except the 0th lane.
-  MVT VT = N->getSimpleValueType(0);
+  [[maybe_unused]] MVT VT = N->getSimpleValueType(0);
   MVT OpVT = A.getSimpleValueType();
   assert(VT == OpVT &&
          "The operand type should be consistent with the result type of UADDV");



More information about the llvm-commits mailing list