diff --git a/mlir/lib/Analysis/LoopAnalysis.cpp b/mlir/lib/Analysis/LoopAnalysis.cpp --- a/mlir/lib/Analysis/LoopAnalysis.cpp +++ b/mlir/lib/Analysis/LoopAnalysis.cpp @@ -220,9 +220,9 @@ template static bool isContiguousAccess(Value iv, LoadOrStoreOp memoryOp, int *memRefDim) { - static_assert(std::is_same::value || - std::is_same::value, - "Must be called on either const LoadOp & or const StoreOp &"); + static_assert( + llvm::is_one_of::value, + "Must be called on either LoadOp or StoreOp"); assert(memRefDim && "memRefDim == nullptr"); auto memRefType = memoryOp.getMemRefType(); diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp --- a/mlir/lib/Analysis/Utils.cpp +++ b/mlir/lib/Analysis/Utils.cpp @@ -368,16 +368,16 @@ return sizeInBytes; } -template -LogicalResult mlir::boundCheckLoadOrStoreOp(LoadOrStoreOpPointer loadOrStoreOp, +template +LogicalResult mlir::boundCheckLoadOrStoreOp(LoadOrStoreOp loadOrStoreOp, bool emitError) { - static_assert(std::is_same::value || - std::is_same::value, - "argument should be either a AffineLoadOp or a AffineStoreOp"); + static_assert( + llvm::is_one_of::value, + "argument should be either a AffineLoadOp or a AffineStoreOp"); - Operation *opInst = loadOrStoreOp.getOperation(); - MemRefRegion region(opInst->getLoc()); - if (failed(region.compute(opInst, /*loopDepth=*/0, /*sliceState=*/nullptr, + Operation *op = loadOrStoreOp.getOperation(); + MemRefRegion region(op->getLoc()); + if (failed(region.compute(op, /*loopDepth=*/0, /*sliceState=*/nullptr, /*addMemRefDimBounds=*/false))) return success(); diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -629,8 +629,7 @@ template static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet, SmallVectorImpl *operands) { - static_assert(std::is_same::value || - std::is_same::value, + static_assert(llvm::is_one_of::value, "Argument must be either of AffineMap or IntegerSet type"); if (!mapOrSet || operands->empty()) @@ -729,13 +728,10 @@ LogicalResult matchAndRewrite(AffineOpTy affineOp, PatternRewriter &rewriter) const override { - static_assert(std::is_same::value || - std::is_same::value || - std::is_same::value || - std::is_same::value || - std::is_same::value || - std::is_same::value, - "affine load/store/apply op expected"); + static_assert(llvm::is_one_of::value, + "affine load/store/apply/prefetch/min/max op expected"); auto map = affineOp.getAffineMap(); AffineMap oldMap = map; auto oldOperands = affineOp.getMapOperands();