Repository navigation
[mlir] Migrate away from {TypeRange,ValueRange}(std::nullopt) (NFC) - #145445
kazutakahirata merged 1 commit into
Conversation
ArrayRef has a constructor that accepts std::nullopt. This constructor dates back to the days when we still had llvm::Optional. Since the use of std::nullopt outside the context of std::optional is kind of abuse and not intuitive to new comers, I would like to move away from the constructor and eventually remove it. This patch migrates away from TypeRagne(std::nullopt) and ValueRange(std::nullopt).
|
@llvm/pr-subscribers-mlir-func @llvm/pr-subscribers-mlir-spirv Author: Kazu Hirata (kazutakahirata) ChangesArrayRef has a constructor that accepts std::nullopt. This Since the use of std::nullopt outside the context of std::optional is This patch migrates away from TypeRagne(std::nullopt) and Full diff: https://github.com/llvm/llvm-project/pull/145445.diff 17 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
index 19fbcf64b2360..e52b7d2090d53 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
@@ -243,17 +243,16 @@ def AffineForOp : Affine_Op<"for",
let regions = (region SizedRegion<1>:$region);
let skipDefaultBuilders = 1;
- let builders = [
- OpBuilder<(ins "int64_t":$lowerBound, "int64_t":$upperBound,
- CArg<"int64_t", "1">:$step, CArg<"ValueRange", "std::nullopt">:$iterArgs,
- CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">:$bodyBuilder)>,
- OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap,
- "ValueRange":$ubOperands, "AffineMap":$ubMap, CArg<"int64_t", "1">:$step,
- CArg<"ValueRange", "std::nullopt">:$iterArgs,
- CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">:$bodyBuilder)>
- ];
+ let builders =
+ [OpBuilder<(ins "int64_t":$lowerBound, "int64_t":$upperBound,
+ CArg<"int64_t", "1">:$step, CArg<"ValueRange", "{}">:$iterArgs,
+ CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
+ "nullptr">:$bodyBuilder)>,
+ OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap,
+ "ValueRange":$ubOperands, "AffineMap":$ubMap,
+ CArg<"int64_t", "1">:$step, CArg<"ValueRange", "{}">:$iterArgs,
+ CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
+ "nullptr">:$bodyBuilder)>];
let extraClassDeclaration = [{
/// Defining the function type we use for building the body of affine.for.
@@ -920,9 +919,7 @@ def AffineYieldOp : Affine_Op<"yield", [Pure, Terminator, ReturnLike,
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [
- OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]>
- ];
+ let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
index 6dbcdefbc9332..a8455c237c864 100644
--- a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
+++ b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
@@ -288,7 +288,7 @@ def Async_ReturnOp : Async_Op<"return",
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [OpBuilder<(ins), [{build($_builder, $_state, std::nullopt);}]>];
+ let builders = [OpBuilder<(ins), [{build($_builder, $_state, {});}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
index cdaeb6461afb4..06ce4f16c867d 100644
--- a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
+++ b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
@@ -385,7 +385,7 @@ def ReturnOp : Func_Op<"return", [Pure, HasParent<"FuncOp">,
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
diff --git a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
index fd213824b30ca..095f6bee2c345 100644
--- a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
+++ b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
@@ -462,7 +462,7 @@ def MLProgram_OutputOp : MLProgram_Op<"output", [
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
@@ -488,7 +488,7 @@ def MLProgram_ReturnOp : MLProgram_Op<"return", [
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
index b51b61b3d2cb9..8b14cef7437d4 100644
--- a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
@@ -248,12 +248,10 @@ def ForOp : SCF_Op<"for",
let regions = (region SizedRegion<1>:$region);
let skipDefaultBuilders = 1;
- let builders = [
- OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step,
- CArg<"ValueRange", "std::nullopt">:$initArgs,
+ let builders = [OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound,
+ "Value":$step, CArg<"ValueRange", "{}">:$initArgs,
CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">)>
- ];
+ "nullptr">)>];
let extraClassDeclaration = [{
using BodyBuilderFn =
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
index 1872c00b74f1a..3143ab7de1b14 100644
--- a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
@@ -227,7 +227,7 @@ def YieldOp : SMTOp<"yield", [
let arguments = (ins Variadic<AnyType>:$values);
let assemblyFormat = "($values^ `:` qualified(type($values)))? attr-dict";
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
}
diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
index 8bccba426ab12..cbf1223298f90 100644
--- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
+++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
@@ -678,9 +678,7 @@ def Shape_YieldOp : Shape_Op<"yield",
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [OpBuilder<(ins),
- [{ build($_builder, $_state, std::nullopt); }]>
- ];
+ let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index 93c76d267c517..b96c3a4e6dfb6 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -251,8 +251,7 @@ lowerAsEntryFunction(gpu::GPUFuncOp funcOp, const TypeConverter &typeConverter,
}
auto newFuncOp = rewriter.create<spirv::FuncOp>(
funcOp.getLoc(), funcOp.getName(),
- rewriter.getFunctionType(signatureConverter.getConvertedTypes(),
- std::nullopt));
+ rewriter.getFunctionType(signatureConverter.getConvertedTypes(), {}));
for (const auto &namedAttr : funcOp->getAttrs()) {
if (namedAttr.getName() == funcOp.getFunctionTypeAttrName() ||
namedAttr.getName() == SymbolTable::getSymbolAttrName())
diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
index 3b4209d47c5c2..bd2846ac388fd 100644
--- a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
+++ b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
@@ -636,7 +636,7 @@ SymbolRefAttr PatternLowering::generateRewriter(
builder.setInsertionPointToEnd(rewriterModule.getBody());
auto rewriterFunc = builder.create<pdl_interp::FuncOp>(
pattern.getLoc(), "pdl_generated_rewriter",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ builder.getFunctionType({}, {}));
rewriterSymbolTable.insert(rewriterFunc);
// Generate the rewriter function body.
@@ -703,7 +703,7 @@ SymbolRefAttr PatternLowering::generateRewriter(
// Update the signature of the rewrite function.
rewriterFunc.setType(builder.getFunctionType(
llvm::to_vector<8>(rewriterFunc.front().getArgumentTypes()),
- /*results=*/std::nullopt));
+ /*results=*/{}));
builder.create<pdl_interp::FinalizeOp>(rewriter.getLoc());
return SymbolRefAttr::get(
@@ -990,7 +990,7 @@ void PDLToPDLInterpPass::runOnOperation() {
auto matcherFunc = builder.create<pdl_interp::FuncOp>(
module.getLoc(), pdl_interp::PDLInterpDialect::getMatcherFunctionName(),
builder.getFunctionType(builder.getType<pdl::OperationType>(),
- /*results=*/std::nullopt),
+ /*results=*/{}),
/*attrs=*/std::nullopt);
// Create a nested module to hold the functions invoked for rewriting the IR
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 39f626b558294..1d77d3d5735e1 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -2302,7 +2302,7 @@ void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
TypeRange resultTypes, Value laneId,
int64_t warpSize) {
build(builder, result, resultTypes, laneId, warpSize,
- /*operands=*/std::nullopt, /*argTypes=*/std::nullopt);
+ /*operands=*/{}, /*argTypes=*/{});
}
void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp
index b3271462df274..79012dbd32f80 100644
--- a/mlir/lib/Dialect/SCF/IR/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -769,7 +769,7 @@ LoopNest mlir::scf::buildLoopNest(
ValueRange steps,
function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilder) {
// Delegate to the main function by wrapping the body builder.
- return buildLoopNest(builder, loc, lbs, ubs, steps, std::nullopt,
+ return buildLoopNest(builder, loc, lbs, ubs, steps, {},
[&bodyBuilder](OpBuilder &nestedBuilder,
Location nestedLoc, ValueRange ivs,
ValueRange) -> ValueVector {
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
index 15ddcf58a3d70..6fd20466e36e3 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
@@ -282,8 +282,8 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
// Creates a new function with the update signature.
rewriter.modifyOpInPlace(funcOp, [&] {
- funcOp.setType(rewriter.getFunctionType(
- signatureConverter.getConvertedTypes(), std::nullopt));
+ funcOp.setType(
+ rewriter.getFunctionType(signatureConverter.getConvertedTypes(), {}));
});
return success();
}
diff --git a/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp b/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
index 5b48e80749c8b..d0b8624d8de23 100644
--- a/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
+++ b/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
@@ -23,9 +23,9 @@ static Operation *createOp(MLIRContext *context, Location loc,
StringRef operationName,
unsigned int numRegions = 0) {
context->allowUnregisteredDialects();
- return Operation::create(loc, OperationName(operationName, context),
- std::nullopt, std::nullopt, std::nullopt,
- OpaqueProperties(nullptr), std::nullopt, numRegions);
+ return Operation::create(loc, OperationName(operationName, context), {}, {},
+ std::nullopt, OpaqueProperties(nullptr),
+ std::nullopt, numRegions);
}
namespace {
diff --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp
index 6ea74a988ca81..0dd46fbd3f104 100644
--- a/mlir/unittests/IR/OperationSupportTest.cpp
+++ b/mlir/unittests/IR/OperationSupportTest.cpp
@@ -44,7 +44,7 @@ TEST(OperandStorageTest, NonResizable) {
EXPECT_EQ(user->getNumOperands(), 1u);
// Removing is okay.
- user->setOperands(std::nullopt);
+ user->setOperands({});
EXPECT_EQ(user->getNumOperands(), 0u);
// Destroy the operations.
@@ -68,7 +68,7 @@ TEST(OperandStorageTest, Resizable) {
EXPECT_EQ(user->getNumOperands(), 1u);
// Removing is okay.
- user->setOperands(std::nullopt);
+ user->setOperands({});
EXPECT_EQ(user->getNumOperands(), 0u);
// Adding more operands is okay.
@@ -236,7 +236,7 @@ TEST(OperationFormatPrintTest, CanPrintNameAsPrefix) {
context.allowUnregisteredDialects();
Operation *op = Operation::create(
NameLoc::get(StringAttr::get(&context, "my_named_loc")),
- OperationName("t.op", &context), builder.getIntegerType(16), std::nullopt,
+ OperationName("t.op", &context), builder.getIntegerType(16), {},
std::nullopt, nullptr, std::nullopt, 0);
std::string str;
diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp
index d494db86a9de9..1a28659f47e64 100644
--- a/mlir/unittests/Pass/AnalysisManagerTest.cpp
+++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp
@@ -63,9 +63,8 @@ TEST(AnalysisManagerTest, FineGrainFunctionAnalysisPreservation) {
// Create a function and a module.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- func::FuncOp func1 =
- func::FuncOp::create(builder.getUnknownLoc(), "foo",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ func::FuncOp func1 = func::FuncOp::create(builder.getUnknownLoc(), "foo",
+ builder.getFunctionType({}, {}));
func1.setPrivate();
module->push_back(func1);
@@ -94,9 +93,8 @@ TEST(AnalysisManagerTest, FineGrainChildFunctionAnalysisPreservation) {
// Create a function and a module.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- func::FuncOp func1 =
- func::FuncOp::create(builder.getUnknownLoc(), "foo",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ func::FuncOp func1 = func::FuncOp::create(builder.getUnknownLoc(), "foo",
+ builder.getFunctionType({}, {}));
func1.setPrivate();
module->push_back(func1);
diff --git a/mlir/unittests/Pass/PassManagerTest.cpp b/mlir/unittests/Pass/PassManagerTest.cpp
index 7ceed3bb3bc3b..7e618811eabf4 100644
--- a/mlir/unittests/Pass/PassManagerTest.cpp
+++ b/mlir/unittests/Pass/PassManagerTest.cpp
@@ -63,9 +63,8 @@ TEST(PassManagerTest, OpSpecificAnalysis) {
// Create a module with 2 functions.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
for (StringRef name : {"secret", "not_secret"}) {
- auto func = func::FuncOp::create(
- builder.getUnknownLoc(), name,
- builder.getFunctionType(std::nullopt, std::nullopt));
+ auto func = func::FuncOp::create(builder.getUnknownLoc(), name,
+ builder.getFunctionType({}, {}));
func.setPrivate();
module->push_back(func);
}
@@ -125,9 +124,8 @@ TEST(PassManagerTest, ExecutionAction) {
// Create a module with 2 functions.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- auto f =
- func::FuncOp::create(builder.getUnknownLoc(), "process_me_once",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ auto f = func::FuncOp::create(builder.getUnknownLoc(), "process_me_once",
+ builder.getFunctionType({}, {}));
f.setPrivate();
module->push_back(f);
diff --git a/mlir/unittests/Transforms/DialectConversion.cpp b/mlir/unittests/Transforms/DialectConversion.cpp
index 10d7fb041278d..1d4a4f7292088 100644
--- a/mlir/unittests/Transforms/DialectConversion.cpp
+++ b/mlir/unittests/Transforms/DialectConversion.cpp
@@ -14,8 +14,8 @@ using namespace mlir;
static Operation *createOp(MLIRContext *context) {
context->allowUnregisteredDialects();
return Operation::create(
- UnknownLoc::get(context), OperationName("foo.bar", context), std::nullopt,
- std::nullopt, std::nullopt, /*properties=*/nullptr, std::nullopt, 0);
+ UnknownLoc::get(context), OperationName("foo.bar", context), {}, {},
+ std::nullopt, /*properties=*/nullptr, std::nullopt, 0);
}
namespace {
|
|
@llvm/pr-subscribers-mlir Author: Kazu Hirata (kazutakahirata) ChangesArrayRef has a constructor that accepts std::nullopt. This Since the use of std::nullopt outside the context of std::optional is This patch migrates away from TypeRagne(std::nullopt) and Full diff: https://github.com/llvm/llvm-project/pull/145445.diff 17 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
index 19fbcf64b2360..e52b7d2090d53 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
@@ -243,17 +243,16 @@ def AffineForOp : Affine_Op<"for",
let regions = (region SizedRegion<1>:$region);
let skipDefaultBuilders = 1;
- let builders = [
- OpBuilder<(ins "int64_t":$lowerBound, "int64_t":$upperBound,
- CArg<"int64_t", "1">:$step, CArg<"ValueRange", "std::nullopt">:$iterArgs,
- CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">:$bodyBuilder)>,
- OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap,
- "ValueRange":$ubOperands, "AffineMap":$ubMap, CArg<"int64_t", "1">:$step,
- CArg<"ValueRange", "std::nullopt">:$iterArgs,
- CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">:$bodyBuilder)>
- ];
+ let builders =
+ [OpBuilder<(ins "int64_t":$lowerBound, "int64_t":$upperBound,
+ CArg<"int64_t", "1">:$step, CArg<"ValueRange", "{}">:$iterArgs,
+ CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
+ "nullptr">:$bodyBuilder)>,
+ OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap,
+ "ValueRange":$ubOperands, "AffineMap":$ubMap,
+ CArg<"int64_t", "1">:$step, CArg<"ValueRange", "{}">:$iterArgs,
+ CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
+ "nullptr">:$bodyBuilder)>];
let extraClassDeclaration = [{
/// Defining the function type we use for building the body of affine.for.
@@ -920,9 +919,7 @@ def AffineYieldOp : Affine_Op<"yield", [Pure, Terminator, ReturnLike,
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [
- OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]>
- ];
+ let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
index 6dbcdefbc9332..a8455c237c864 100644
--- a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
+++ b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
@@ -288,7 +288,7 @@ def Async_ReturnOp : Async_Op<"return",
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [OpBuilder<(ins), [{build($_builder, $_state, std::nullopt);}]>];
+ let builders = [OpBuilder<(ins), [{build($_builder, $_state, {});}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
index cdaeb6461afb4..06ce4f16c867d 100644
--- a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
+++ b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td
@@ -385,7 +385,7 @@ def ReturnOp : Func_Op<"return", [Pure, HasParent<"FuncOp">,
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
diff --git a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
index fd213824b30ca..095f6bee2c345 100644
--- a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
+++ b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
@@ -462,7 +462,7 @@ def MLProgram_OutputOp : MLProgram_Op<"output", [
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
@@ -488,7 +488,7 @@ def MLProgram_ReturnOp : MLProgram_Op<"return", [
let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
index b51b61b3d2cb9..8b14cef7437d4 100644
--- a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
@@ -248,12 +248,10 @@ def ForOp : SCF_Op<"for",
let regions = (region SizedRegion<1>:$region);
let skipDefaultBuilders = 1;
- let builders = [
- OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step,
- CArg<"ValueRange", "std::nullopt">:$initArgs,
+ let builders = [OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound,
+ "Value":$step, CArg<"ValueRange", "{}">:$initArgs,
CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
- "nullptr">)>
- ];
+ "nullptr">)>];
let extraClassDeclaration = [{
using BodyBuilderFn =
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
index 1872c00b74f1a..3143ab7de1b14 100644
--- a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
@@ -227,7 +227,7 @@ def YieldOp : SMTOp<"yield", [
let arguments = (ins Variadic<AnyType>:$values);
let assemblyFormat = "($values^ `:` qualified(type($values)))? attr-dict";
let builders = [OpBuilder<(ins), [{
- build($_builder, $_state, std::nullopt);
+ build($_builder, $_state, {});
}]>];
}
diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
index 8bccba426ab12..cbf1223298f90 100644
--- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
+++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
@@ -678,9 +678,7 @@ def Shape_YieldOp : Shape_Op<"yield",
let arguments = (ins Variadic<AnyType>:$operands);
- let builders = [OpBuilder<(ins),
- [{ build($_builder, $_state, std::nullopt); }]>
- ];
+ let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
let hasVerifier = 1;
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index 93c76d267c517..b96c3a4e6dfb6 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -251,8 +251,7 @@ lowerAsEntryFunction(gpu::GPUFuncOp funcOp, const TypeConverter &typeConverter,
}
auto newFuncOp = rewriter.create<spirv::FuncOp>(
funcOp.getLoc(), funcOp.getName(),
- rewriter.getFunctionType(signatureConverter.getConvertedTypes(),
- std::nullopt));
+ rewriter.getFunctionType(signatureConverter.getConvertedTypes(), {}));
for (const auto &namedAttr : funcOp->getAttrs()) {
if (namedAttr.getName() == funcOp.getFunctionTypeAttrName() ||
namedAttr.getName() == SymbolTable::getSymbolAttrName())
diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
index 3b4209d47c5c2..bd2846ac388fd 100644
--- a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
+++ b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
@@ -636,7 +636,7 @@ SymbolRefAttr PatternLowering::generateRewriter(
builder.setInsertionPointToEnd(rewriterModule.getBody());
auto rewriterFunc = builder.create<pdl_interp::FuncOp>(
pattern.getLoc(), "pdl_generated_rewriter",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ builder.getFunctionType({}, {}));
rewriterSymbolTable.insert(rewriterFunc);
// Generate the rewriter function body.
@@ -703,7 +703,7 @@ SymbolRefAttr PatternLowering::generateRewriter(
// Update the signature of the rewrite function.
rewriterFunc.setType(builder.getFunctionType(
llvm::to_vector<8>(rewriterFunc.front().getArgumentTypes()),
- /*results=*/std::nullopt));
+ /*results=*/{}));
builder.create<pdl_interp::FinalizeOp>(rewriter.getLoc());
return SymbolRefAttr::get(
@@ -990,7 +990,7 @@ void PDLToPDLInterpPass::runOnOperation() {
auto matcherFunc = builder.create<pdl_interp::FuncOp>(
module.getLoc(), pdl_interp::PDLInterpDialect::getMatcherFunctionName(),
builder.getFunctionType(builder.getType<pdl::OperationType>(),
- /*results=*/std::nullopt),
+ /*results=*/{}),
/*attrs=*/std::nullopt);
// Create a nested module to hold the functions invoked for rewriting the IR
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 39f626b558294..1d77d3d5735e1 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -2302,7 +2302,7 @@ void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
TypeRange resultTypes, Value laneId,
int64_t warpSize) {
build(builder, result, resultTypes, laneId, warpSize,
- /*operands=*/std::nullopt, /*argTypes=*/std::nullopt);
+ /*operands=*/{}, /*argTypes=*/{});
}
void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp
index b3271462df274..79012dbd32f80 100644
--- a/mlir/lib/Dialect/SCF/IR/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -769,7 +769,7 @@ LoopNest mlir::scf::buildLoopNest(
ValueRange steps,
function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilder) {
// Delegate to the main function by wrapping the body builder.
- return buildLoopNest(builder, loc, lbs, ubs, steps, std::nullopt,
+ return buildLoopNest(builder, loc, lbs, ubs, steps, {},
[&bodyBuilder](OpBuilder &nestedBuilder,
Location nestedLoc, ValueRange ivs,
ValueRange) -> ValueVector {
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
index 15ddcf58a3d70..6fd20466e36e3 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
@@ -282,8 +282,8 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
// Creates a new function with the update signature.
rewriter.modifyOpInPlace(funcOp, [&] {
- funcOp.setType(rewriter.getFunctionType(
- signatureConverter.getConvertedTypes(), std::nullopt));
+ funcOp.setType(
+ rewriter.getFunctionType(signatureConverter.getConvertedTypes(), {}));
});
return success();
}
diff --git a/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp b/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
index 5b48e80749c8b..d0b8624d8de23 100644
--- a/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
+++ b/mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp
@@ -23,9 +23,9 @@ static Operation *createOp(MLIRContext *context, Location loc,
StringRef operationName,
unsigned int numRegions = 0) {
context->allowUnregisteredDialects();
- return Operation::create(loc, OperationName(operationName, context),
- std::nullopt, std::nullopt, std::nullopt,
- OpaqueProperties(nullptr), std::nullopt, numRegions);
+ return Operation::create(loc, OperationName(operationName, context), {}, {},
+ std::nullopt, OpaqueProperties(nullptr),
+ std::nullopt, numRegions);
}
namespace {
diff --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp
index 6ea74a988ca81..0dd46fbd3f104 100644
--- a/mlir/unittests/IR/OperationSupportTest.cpp
+++ b/mlir/unittests/IR/OperationSupportTest.cpp
@@ -44,7 +44,7 @@ TEST(OperandStorageTest, NonResizable) {
EXPECT_EQ(user->getNumOperands(), 1u);
// Removing is okay.
- user->setOperands(std::nullopt);
+ user->setOperands({});
EXPECT_EQ(user->getNumOperands(), 0u);
// Destroy the operations.
@@ -68,7 +68,7 @@ TEST(OperandStorageTest, Resizable) {
EXPECT_EQ(user->getNumOperands(), 1u);
// Removing is okay.
- user->setOperands(std::nullopt);
+ user->setOperands({});
EXPECT_EQ(user->getNumOperands(), 0u);
// Adding more operands is okay.
@@ -236,7 +236,7 @@ TEST(OperationFormatPrintTest, CanPrintNameAsPrefix) {
context.allowUnregisteredDialects();
Operation *op = Operation::create(
NameLoc::get(StringAttr::get(&context, "my_named_loc")),
- OperationName("t.op", &context), builder.getIntegerType(16), std::nullopt,
+ OperationName("t.op", &context), builder.getIntegerType(16), {},
std::nullopt, nullptr, std::nullopt, 0);
std::string str;
diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp
index d494db86a9de9..1a28659f47e64 100644
--- a/mlir/unittests/Pass/AnalysisManagerTest.cpp
+++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp
@@ -63,9 +63,8 @@ TEST(AnalysisManagerTest, FineGrainFunctionAnalysisPreservation) {
// Create a function and a module.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- func::FuncOp func1 =
- func::FuncOp::create(builder.getUnknownLoc(), "foo",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ func::FuncOp func1 = func::FuncOp::create(builder.getUnknownLoc(), "foo",
+ builder.getFunctionType({}, {}));
func1.setPrivate();
module->push_back(func1);
@@ -94,9 +93,8 @@ TEST(AnalysisManagerTest, FineGrainChildFunctionAnalysisPreservation) {
// Create a function and a module.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- func::FuncOp func1 =
- func::FuncOp::create(builder.getUnknownLoc(), "foo",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ func::FuncOp func1 = func::FuncOp::create(builder.getUnknownLoc(), "foo",
+ builder.getFunctionType({}, {}));
func1.setPrivate();
module->push_back(func1);
diff --git a/mlir/unittests/Pass/PassManagerTest.cpp b/mlir/unittests/Pass/PassManagerTest.cpp
index 7ceed3bb3bc3b..7e618811eabf4 100644
--- a/mlir/unittests/Pass/PassManagerTest.cpp
+++ b/mlir/unittests/Pass/PassManagerTest.cpp
@@ -63,9 +63,8 @@ TEST(PassManagerTest, OpSpecificAnalysis) {
// Create a module with 2 functions.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
for (StringRef name : {"secret", "not_secret"}) {
- auto func = func::FuncOp::create(
- builder.getUnknownLoc(), name,
- builder.getFunctionType(std::nullopt, std::nullopt));
+ auto func = func::FuncOp::create(builder.getUnknownLoc(), name,
+ builder.getFunctionType({}, {}));
func.setPrivate();
module->push_back(func);
}
@@ -125,9 +124,8 @@ TEST(PassManagerTest, ExecutionAction) {
// Create a module with 2 functions.
OwningOpRef<ModuleOp> module(ModuleOp::create(UnknownLoc::get(&context)));
- auto f =
- func::FuncOp::create(builder.getUnknownLoc(), "process_me_once",
- builder.getFunctionType(std::nullopt, std::nullopt));
+ auto f = func::FuncOp::create(builder.getUnknownLoc(), "process_me_once",
+ builder.getFunctionType({}, {}));
f.setPrivate();
module->push_back(f);
diff --git a/mlir/unittests/Transforms/DialectConversion.cpp b/mlir/unittests/Transforms/DialectConversion.cpp
index 10d7fb041278d..1d4a4f7292088 100644
--- a/mlir/unittests/Transforms/DialectConversion.cpp
+++ b/mlir/unittests/Transforms/DialectConversion.cpp
@@ -14,8 +14,8 @@ using namespace mlir;
static Operation *createOp(MLIRContext *context) {
context->allowUnregisteredDialects();
return Operation::create(
- UnknownLoc::get(context), OperationName("foo.bar", context), std::nullopt,
- std::nullopt, std::nullopt, /*properties=*/nullptr, std::nullopt, 0);
+ UnknownLoc::get(context), OperationName("foo.bar", context), {}, {},
+ std::nullopt, /*properties=*/nullptr, std::nullopt, 0);
}
namespace {
|
…lvm#145445) ArrayRef has a constructor that accepts std::nullopt. This constructor dates back to the days when we still had llvm::Optional. Since the use of std::nullopt outside the context of std::optional is kind of abuse and not intuitive to new comers, I would like to move away from the constructor and eventually remove it. This patch migrates away from TypeRagne(std::nullopt) and ValueRange(std::nullopt).
…lvm#145445) ArrayRef has a constructor that accepts std::nullopt. This constructor dates back to the days when we still had llvm::Optional. Since the use of std::nullopt outside the context of std::optional is kind of abuse and not intuitive to new comers, I would like to move away from the constructor and eventually remove it. This patch migrates away from TypeRagne(std::nullopt) and ValueRange(std::nullopt).
## Version and Build Flow
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
## Python Bindings
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
## MLIR API
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
## GPU and AMX
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
## LLVM Source Lists
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
## RISC-V Backend
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
## Tool API and Link Libraries
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
ArrayRef has a constructor that accepts std::nullopt. This
constructor dates back to the days when we still had llvm::Optional.
Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.
This patch migrates away from TypeRagne(std::nullopt) and
ValueRange(std::nullopt).