[Mlir-commits] [mlir] 7236e5d - Revert clang-tidy fixes for readability-simplify-boolean-expr and add NOLINT
Arjun P
llvmlistbot at llvm.org
Wed Jun 29 04:23:34 PDT 2022
Author: Arjun P
Date: 2022-06-29T12:23:35+01:00
New Revision: 7236e5de5475902459038a700a4f095349c51228
URL: https://github.com/llvm/llvm-project/commit/7236e5de5475902459038a700a4f095349c51228
DIFF: https://github.com/llvm/llvm-project/commit/7236e5de5475902459038a700a4f095349c51228.diff
LOG: Revert clang-tidy fixes for readability-simplify-boolean-expr and add NOLINT
The original code is more readable because the goal is to check if the given
value does *not* lie in the range. It is harder to understand this by
reading the rewritten code.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D128753
Added:
Modified:
mlir/lib/Analysis/Presburger/Utils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Analysis/Presburger/Utils.cpp b/mlir/lib/Analysis/Presburger/Utils.cpp
index 199261789f70..4da07c0f84a7 100644
--- a/mlir/lib/Analysis/Presburger/Utils.cpp
+++ b/mlir/lib/Analysis/Presburger/Utils.cpp
@@ -120,7 +120,7 @@ static LogicalResult getDivRepr(const IntegerRelation &cst, unsigned pos,
// Check if `c` satisfies the condition `0 <= c <= divisor - 1`. This also
// implictly checks that `divisor` is positive.
- if (c < 0 || c > divisor - 1)
+ if (!(0 <= c && c <= divisor - 1)) // NOLINT
return failure();
// The inequality pair can be used to extract the division.
More information about the Mlir-commits
mailing list