[Mlir-commits] [mlir] [mlir][QuasiPolynomial] Fixed unused variable error (PR #76417)

Balaji V. Iyer. llvmlistbot at llvm.org
Tue Dec 26 15:55:46 PST 2023


https://github.com/bviyer created https://github.com/llvm/llvm-project/pull/76417

One of the variable `aff` is used inside an assert. When the asserts are removed, the compiler complains of unused variable. This patch should fix this issue.

>From 9e15e1a62233295c5e70cea06681b02502a2db9a Mon Sep 17 00:00:00 2001
From: "Balaji V. Iyer" <bviyer at gmail.com>
Date: Tue, 26 Dec 2023 17:19:30 -0600
Subject: [PATCH] [mlir][QuasiPolynomial] Fixed unused variable error

One of the variable `aff` is used inside an assert. When the asserts
are removed, the compiler complains of unused variable. This patch
should fix this issue.
---
 mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp b/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
index 902e3ced472f82..d26959b79953d0 100644
--- a/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
+++ b/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
@@ -30,6 +30,7 @@ QuasiPolynomial::QuasiPolynomial(
       assert(aff.size() == getNumInputs() + 1 &&
              "dimensionality of affine functions does not match number of "
              "symbols!");
+      (void) aff;
     }
   }
 }
@@ -110,4 +111,4 @@ QuasiPolynomial QuasiPolynomial::simplify() {
     newAffine.push_back(affine[i]);
   }
   return QuasiPolynomial(getNumInputs(), newCoeffs, newAffine);
-}
\ No newline at end of file
+}



More information about the Mlir-commits mailing list