Skip to content

Conversation

@wecing
Copy link
Contributor

@wecing wecing commented Jun 6, 2025

AArch64ISelLowering.cpp currently fails -Wunused-variable because SrcVT is only used in assert(), so it is an unused variable if not using debug builds. This behavior was introduced in 2c0a226.

AArch64ISelLowering.cpp currently fails -Wunused-variable because
SrcVT is only used in assert(), so it is an unused variable if not
using debug builds. This behavior was introduced in 2c0a226.
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Chenguang Wang (wecing)

Changes

AArch64ISelLowering.cpp currently fails -Wunused-variable because SrcVT is only used in assert(), so it is an unused variable if not using debug builds. This behavior was introduced in 2c0a226.


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

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+1-2)
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 724e3eac3b69e..379f07e14948c 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -11040,8 +11040,7 @@ SDValue AArch64TargetLowering::LowerSETCCCARRY(SDValue Op,
 static SDValue emitVectorComparison(SDValue LHS, SDValue RHS,
                                     AArch64CC::CondCode CC, bool NoNans, EVT VT,
                                     const SDLoc &DL, SelectionDAG &DAG) {
-  EVT SrcVT = LHS.getValueType();
-  assert(VT.getSizeInBits() == SrcVT.getSizeInBits() &&
+  assert(VT.getSizeInBits() == LHS.getValueType().getSizeInBits() &&
          "function only supposed to emit natural comparisons");
 
   switch (CC) {

@wecing wecing requested a review from guy-david June 6, 2025 17:26
Copy link
Contributor

@guy-david guy-david left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@wecing wecing merged commit 45c3053 into llvm:main Jun 6, 2025
7 of 9 checks passed
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
AArch64ISelLowering.cpp currently fails -Wunused-variable because SrcVT
is only used in assert(), so it is an unused variable if not using debug
builds. This behavior was introduced in 2c0a226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants