diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp index bd2846ac388fd..945d38e929e08 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp +++ b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp @@ -991,7 +991,7 @@ void PDLToPDLInterpPass::runOnOperation() { module.getLoc(), pdl_interp::PDLInterpDialect::getMatcherFunctionName(), builder.getFunctionType(builder.getType(), /*results=*/{}), - /*attrs=*/std::nullopt); + /*attrs=*/ArrayRef()); // Create a nested module to hold the functions invoked for rewriting the IR // after a successful match. diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp index 923f5f67b865a..c2be08ef40f21 100644 --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp @@ -310,8 +310,8 @@ static Value createLinalgBodyCalculationForElementwiseOp( auto shifted = rewriter.create(loc, resultTypes, args[0], subtract) ->getResults(); - auto truncated = - rewriter.create(loc, i1Ty, shifted, std::nullopt); + auto truncated = rewriter.create( + loc, i1Ty, shifted, ArrayRef()); auto isInputOdd = rewriter.create(loc, i1Ty, truncated, i1one); @@ -552,20 +552,20 @@ static Value createLinalgBodyCalculationForElementwiseOp( if (isa(srcTy) && isa(dstTy) && bitExtend) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); if (isa(srcTy) && isa(dstTy) && !bitExtend) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); // 1-bit integers need to be treated as signless. if (srcTy.isInteger(1) && arith::UIToFPOp::areCastCompatible(srcTy, dstTy)) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); if (srcTy.isInteger(1) && isa(dstTy) && bitExtend) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); // Unsigned integers need an unrealized cast so that they can be passed // to UIToFP. @@ -583,7 +583,7 @@ static Value createLinalgBodyCalculationForElementwiseOp( // All other si-to-fp conversions should be handled by SIToFP. if (arith::SIToFPOp::areCastCompatible(srcTy, dstTy)) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); // Casting to boolean, floats need to only be checked as not-equal to zero. if (isa(srcTy) && dstTy.isInteger(1)) { @@ -690,7 +690,7 @@ static Value createLinalgBodyCalculationForElementwiseOp( if (isa(srcTy) && isa(dstTy) && bitExtend) return rewriter.create(loc, resultTypes, args, - std::nullopt); + ArrayRef()); if (isa(srcTy) && isa(dstTy) && !bitExtend) { return rewriter.create(loc, dstTy, args[0]); diff --git a/mlir/lib/Dialect/GPU/Transforms/DecomposeMemRefs.cpp b/mlir/lib/Dialect/GPU/Transforms/DecomposeMemRefs.cpp index 695d43b04cff0..f63af8da28087 100644 --- a/mlir/lib/Dialect/GPU/Transforms/DecomposeMemRefs.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/DecomposeMemRefs.cpp @@ -111,7 +111,8 @@ static Value getFlatMemref(OpBuilder &rewriter, Location loc, Value source, getFlatOffsetAndStrides(rewriter, loc, source, offsetsTemp); MemRefType retType = inferCastResultType(base, offset); return rewriter.create(loc, retType, base, offset, - std::nullopt, std::nullopt); + ArrayRef(), + ArrayRef()); } static bool needFlatten(Value val) { diff --git a/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp b/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp index 29bc49b78f15d..824201d17b5ab 100644 --- a/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp +++ b/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp @@ -350,8 +350,9 @@ Value CodeGen::genNonInitializerVar(const ast::VariableDecl *varDecl, Value results = builder.create( loc, pdl::RangeType::get(builder.getType()), /*types=*/ArrayAttr()); - return builder.create( - loc, opType.getName(), operands, std::nullopt, ValueRange(), results); + return builder.create(loc, opType.getName(), operands, + ArrayRef(), ValueRange(), + results); } if (ast::RangeType rangeTy = dyn_cast(type)) { diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp index 9126736d1d175..6b22b171822ae 100644 --- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp +++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp @@ -1014,7 +1014,7 @@ struct TestPassthroughInvalidOp : public ConversionPattern { .getResult()); } rewriter.replaceOpWithNewOp(op, TypeRange(), flattened, - std::nullopt); + ArrayRef()); return success(); } }; @@ -1030,7 +1030,7 @@ struct TestDropAndReplaceInvalidOp : public ConversionPattern { matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { rewriter.replaceOpWithNewOp(op, TypeRange(), ValueRange(), - std::nullopt); + ArrayRef()); return success(); } };