[Mlir-commits] [mlir] 1d2ce7d - [MLIR][NFC] Fix clang-tidy warnings in IntegerSet.h
Uday Bondhugula
llvmlistbot at llvm.org
Sun May 16 00:00:57 PDT 2021
Author: Uday Bondhugula
Date: 2021-05-16T12:26:12+05:30
New Revision: 1d2ce7d6d67f9c715941cd7a42b3a06930ce74d6
URL: https://github.com/llvm/llvm-project/commit/1d2ce7d6d67f9c715941cd7a42b3a06930ce74d6
DIFF: https://github.com/llvm/llvm-project/commit/1d2ce7d6d67f9c715941cd7a42b3a06930ce74d6.diff
LOG: [MLIR][NFC] Fix clang-tidy warnings in IntegerSet.h
Fix clang-tidy warnings and some comments in IntegerSet.h. NFC.
Differential Revision: https://reviews.llvm.org/D102387
Added:
Modified:
mlir/include/mlir/IR/IntegerSet.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/IntegerSet.h b/mlir/include/mlir/IR/IntegerSet.h
index c752822fc4534..7a7457a213c33 100644
--- a/mlir/include/mlir/IR/IntegerSet.h
+++ b/mlir/include/mlir/IR/IntegerSet.h
@@ -11,7 +11,8 @@
// integer sets in the IR - for 'affine.if' operations and as attributes of
// other operations. It is typically expected to contain only a handful of
// affine constraints, and is immutable like an affine map. Integer sets are not
-// unique'd - although affine expressions that make up its equalities and
+// unique'd unless the number of constraints they contain are below a certain
+// threshold - although affine expressions that make up its equalities and
// inequalities are themselves unique.
// This class is not meant for affine analysis and operations like set
@@ -30,13 +31,14 @@ namespace mlir {
namespace detail {
struct IntegerSetStorage;
-}
+} // end namespace detail
class MLIRContext;
/// An integer set representing a conjunction of one or more affine equalities
/// and inequalities. An integer set in the IR is immutable like the affine map,
-/// but integer sets are not unique'd. The affine expressions that make up the
+/// but integer sets are not unique'd unless the number of constraints in them
+/// is below `kUniquingThreshold`. The affine expressions that make up the
/// equalities and inequalities of an integer set are themselves unique and are
/// allocated by the bump pointer allocator.
class IntegerSet {
@@ -54,7 +56,7 @@ class IntegerSet {
static IntegerSet getEmptySet(unsigned numDims, unsigned numSymbols,
MLIRContext *context) {
auto one = getAffineConstantExpr(1, context);
- /* 1 == 0 */
+ // 1 == 0.
return get(numDims, numSymbols, one, true);
}
@@ -127,14 +129,14 @@ inline ::llvm::hash_code hash_value(IntegerSet arg) {
} // end namespace mlir
namespace llvm {
-// IntegerSet hash just like pointers
+// IntegerSet hash just like pointers.
template <> struct DenseMapInfo<mlir::IntegerSet> {
static mlir::IntegerSet getEmptyKey() {
- auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+ auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
return mlir::IntegerSet(static_cast<mlir::IntegerSet::ImplType *>(pointer));
}
static mlir::IntegerSet getTombstoneKey() {
- auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+ auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
return mlir::IntegerSet(static_cast<mlir::IntegerSet::ImplType *>(pointer));
}
static unsigned getHashValue(mlir::IntegerSet val) {
More information about the Mlir-commits
mailing list