[Mlir-commits] [mlir] fe2cc16 - [NFC][MLIR] Fix -Wtype-limits warning
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jun 1 08:43:15 PDT 2022
Author: PeixinQiao
Date: 2022-06-01T23:42:07+08:00
New Revision: fe2cc16035eaab27619fb8be7dd85845c00bda9d
URL: https://github.com/llvm/llvm-project/commit/fe2cc16035eaab27619fb8be7dd85845c00bda9d
DIFF: https://github.com/llvm/llvm-project/commit/fe2cc16035eaab27619fb8be7dd85845c00bda9d.diff
LOG: [NFC][MLIR] Fix -Wtype-limits warning
Fix the warning: comparison of unsigned expression in ‘>= 0’ is always
true.
Reviewed By: kiranchandramohan, shraiysh
Differential Revision: https://reviews.llvm.org/D126784
Added:
Modified:
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
index 18b7eb9457139..8d3654ce37ba4 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();
}
}];
More information about the Mlir-commits
mailing list