[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:47:50 PST 2025


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

>From f59d3e605521a8aae768562c7bade63825a75c17 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 42b35e8b57c07d..16c64f32ab6349 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2461,7 +2461,8 @@ 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