diff --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h --- a/mlir/include/mlir/IR/AffineExpr.h +++ b/mlir/include/mlir/IR/AffineExpr.h @@ -82,7 +82,7 @@ bool operator!() const { return expr == nullptr; } template - bool isa() const; + constexpr bool isa() const; template U dyn_cast() const; template @@ -267,14 +267,14 @@ raw_ostream &operator<<(raw_ostream &os, AffineExpr expr); template -bool AffineExpr::isa() const { - if (std::is_same::value) +constexpr bool AffineExpr::isa() const { + if constexpr (std::is_same_v) return getKind() <= AffineExprKind::LAST_AFFINE_BINARY_OP; - if (std::is_same::value) + if constexpr (std::is_same_v) return getKind() == AffineExprKind::DimId; - if (std::is_same::value) + if constexpr (std::is_same_v) return getKind() == AffineExprKind::SymbolId; - if (std::is_same::value) + if constexpr (std::is_same_v) return getKind() == AffineExprKind::Constant; } template diff --git a/mlir/include/mlir/Support/StorageUniquer.h b/mlir/include/mlir/Support/StorageUniquer.h --- a/mlir/include/mlir/Support/StorageUniquer.h +++ b/mlir/include/mlir/Support/StorageUniquer.h @@ -149,7 +149,7 @@ void registerParametricStorageType(TypeID id) { // If the storage is trivially destructible, we don't need a destructor // function. - if (std::is_trivially_destructible::value) + if constexpr (std::is_trivially_destructible_v) return registerParametricStorageTypeImpl(id, nullptr); registerParametricStorageTypeImpl(id, [](BaseStorage *storage) { static_cast(storage)->~Storage();