[llvm] Add [[maybe_unused]] to a variable used only in assert in VPlan.h (PR #124173)

Karlo Basioli via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 10:38:59 PST 2025


https://github.com/basioli-k created https://github.com/llvm/llvm-project/pull/124173

None

>From cb616f8d010142ec3b115e089e90345dcb943aa0 Mon Sep 17 00:00:00 2001
From: basioli-k <k.basioli at gmail.com>
Date: Thu, 23 Jan 2025 18:37:35 +0000
Subject: [PATCH] Add [[maybe_unused]] to a variable used only in assert in
 VPlan.h

---
 llvm/lib/Transforms/Vectorize/VPlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 42b35e8b57c07d..3dd9c139d8f8c7 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2461,7 +2461,7 @@ class VPPartialReductionRecipe : public VPSingleDefRecipe {
       : VPSingleDefRecipe(VPDef::VPPartialReductionSC,
                           ArrayRef<VPValue *>({Op0, Op1}), ReductionInst),
         Opcode(Opcode) {
-    auto *AccumulatorRecipe = getOperand(1)->getDefiningRecipe();
+    [[maybe_unused]] auto *AccumulatorRecipe = getOperand(1)->getDefiningRecipe();
     assert((isa<VPReductionPHIRecipe>(AccumulatorRecipe) ||
             isa<VPPartialReductionRecipe>(AccumulatorRecipe)) &&
            "Unexpected operand order for partial reduction recipe");



More information about the llvm-commits mailing list