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

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 05:24:30 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Martin Storsjö (mstorsjo)

<details>
<summary>Changes</summary>

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);
           |       ^~

---
Full diff: https://github.com/llvm/llvm-project/pull/159344.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 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");

``````````

</details>


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


More information about the llvm-commits mailing list