From fe2cc16035eaab27619fb8be7dd85845c00bda9d Mon Sep 17 00:00:00 2001 From: PeixinQiao Date: Wed, 1 Jun 2022 23:42:07 +0800 Subject: [PATCH] [NFC][MLIR] Fix -Wtype-limits warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the warning: comparison of unsigned expression in ‘>= 0’ is always true. Reviewed By: kiranchandramohan, shraiysh Differential Revision: https://reviews.llvm.org/D126784 --- mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td index 18b7eb945713..8d3654ce37ba 100644 --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -823,7 +823,7 @@ def AtomicReadOp : OpenMP_Op<"atomic.read", [AllTypesMatch<["x", "v"]>]> { /// The i-th variable operand passed. Value getVariableOperand(unsigned i) { - assert(0 <= i && i < 2 && "invalid index position for an operand"); + assert(i < 2 && "invalid index position for an operand"); return i == 0 ? x() : v(); } }]; @@ -871,7 +871,7 @@ def AtomicWriteOp : OpenMP_Op<"atomic.write"> { /// The i-th variable operand passed. Value getVariableOperand(unsigned i) { - assert(0 <= i && i < 2 && "invalid index position for an operand"); + assert(i < 2 && "invalid index position for an operand"); return i == 0 ? address() : value(); } }];