[flang-commits] [flang] 363b655 - Finish renaming getOperandSegmentSizeAttr() from `operand_segment_sizes` to `operandSegmentSizes`
Mehdi Amini via flang-commits
flang-commits at lists.llvm.org
Wed Aug 9 19:37:39 PDT 2023
Author: Mehdi Amini
Date: 2023-08-09T19:37:01-07:00
New Revision: 363b655920c49a4bcb0869f820ed40aac834eebd
URL: https://github.com/llvm/llvm-project/commit/363b655920c49a4bcb0869f820ed40aac834eebd
DIFF: https://github.com/llvm/llvm-project/commit/363b655920c49a4bcb0869f820ed40aac834eebd.diff
LOG: Finish renaming getOperandSegmentSizeAttr() from `operand_segment_sizes` to `operandSegmentSizes`
This renaming started with the native ODS support for properties, this is completing it.
A mass automated textual rename seems safe for most codebases.
Drop also the ods prefix to keep the accessors the same as they were before
this change:
properties.odsOperandSegmentSizes
reverts back to:
properties.operandSegementSizes
The ODS prefix was creating divergence between all the places and make it harder to
be consistent.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D157173
Added:
Modified:
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
flang/test/Fir/convert-to-llvm.fir
mlir/docs/PatternRewriter.md
mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/IR/OpDefinition.h
mlir/lib/Bindings/Python/IRCore.cpp
mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
mlir/lib/Dialect/Async/IR/Async.cpp
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/SCF/IR/SCF.cpp
mlir/lib/Rewrite/ByteCode.cpp
mlir/test/Bytecode/operand_segment_sizes.mlir
mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
mlir/test/Dialect/GPU/invalid.mlir
mlir/test/Dialect/LLVMIR/invalid.mlir
mlir/test/Dialect/Linalg/named-ops.mlir
mlir/test/Dialect/OpenMP/invalid.mlir
mlir/test/Dialect/OpenMP/ops.mlir
mlir/test/Dialect/PDL/invalid.mlir
mlir/test/Dialect/PDLInterp/invalid.mlir
mlir/test/Dialect/SCF/invalid.mlir
mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir
mlir/test/Dialect/Transform/ops-invalid.mlir
mlir/test/IR/parser.mlir
mlir/test/IR/traits.mlir
mlir/test/Rewrite/pdl-bytecode.mlir
mlir/test/Target/LLVMIR/omptarget-llvm.mlir
mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir
mlir/test/Target/LLVMIR/omptarget-region-llvm.mlir
mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir
mlir/test/Target/LLVMIR/openmp-llvm.mlir
mlir/test/Transforms/canonicalize-block-merge.mlir
mlir/test/Transforms/sccp.mlir
mlir/test/lib/Dialect/Test/TestOpsSyntax.td
mlir/test/mlir-tblgen/op-decl-and-defs.td
mlir/test/mlir-tblgen/op-python-bindings.td
mlir/test/python/dialects/linalg/ops.py
mlir/test/python/dialects/ods_helpers.py
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
mlir/tools/mlir-tblgen/OpFormatGen.cpp
mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
mlir/unittests/IR/AdaptorTest.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 1704c248d4f51e..11fc8473d1734c 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -128,9 +128,8 @@ static mlir::ParseResult parseAllocatableOp(FN wrapResultType,
parser.emitError(parser.getNameLoc(), "invalid allocate type: ") << intype;
return mlir::failure();
}
- result.addAttribute(
- "operand_segment_sizes",
- builder.getDenseI32ArrayAttr({typeparamsSize, shapeSize}));
+ result.addAttribute("operandSegmentSizes", builder.getDenseI32ArrayAttr(
+ {typeparamsSize, shapeSize}));
if (parser.parseOptionalAttrDict(result.attributes) ||
parser.addTypeToList(restype, result.types))
return mlir::failure();
@@ -149,7 +148,7 @@ static void printAllocatableOp(mlir::OpAsmPrinter &p, OP &op) {
p << ", ";
p.printOperand(sh);
}
- p.printOptionalAttrDict(op->getAttrs(), {"in_type", "operand_segment_sizes"});
+ p.printOptionalAttrDict(op->getAttrs(), {"in_type", "operandSegmentSizes"});
}
//===----------------------------------------------------------------------===//
diff --git a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
index b9b46c24098c8e..06fc1d0edbe2e6 100644
--- a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
+++ b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
@@ -28,7 +28,7 @@ func.func @_QPsb1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref<!
// CHECK: %[[ONE_2:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: omp.parallel {
// CHECK: %[[ONE_3:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[I_VAR:.*]] = llvm.alloca %[[ONE_3]] x i32 {adapt.valuebyref, in_type = i32, operand_segment_sizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[I_VAR:.*]] = llvm.alloca %[[ONE_3]] x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
// CHECK: %[[N:.*]] = llvm.load %[[N_REF]] : !llvm.ptr<i32>
// CHECK: omp.wsloop nowait
// CHECK-SAME: for (%[[I:.*]]) : i32 = (%[[ONE_2]]) to (%[[N]]) inclusive step (%[[ONE_2]]) {
@@ -200,7 +200,7 @@ func.func @_QPsimd1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref
// CHECK: %[[ONE_2:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: omp.parallel {
// CHECK: %[[ONE_3:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[I_VAR:.*]] = llvm.alloca %[[ONE_3]] x i32 {adapt.valuebyref, in_type = i32, operand_segment_sizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[I_VAR:.*]] = llvm.alloca %[[ONE_3]] x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
// CHECK: %[[N:.*]] = llvm.load %[[N_REF]] : !llvm.ptr<i32>
// CHECK: omp.simdloop
// CHECK-SAME: (%[[I:.*]]) : i32 = (%[[ONE_2]]) to (%[[N]]) step (%[[ONE_2]]) {
@@ -231,13 +231,13 @@ func.func @_QPomp_target_data() {
// CHECK-LABEL: llvm.func @_QPomp_target_data() {
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<1024 x i32> {bindc_name = "a", in_type = !fir.array<1024xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEa"} : (i64) -> !llvm.ptr<array<1024 x i32>>
+// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<1024 x i32> {bindc_name = "a", in_type = !fir.array<1024xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEa"} : (i64) -> !llvm.ptr<array<1024 x i32>>
// CHECK: %[[VAL_2:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_3:.*]] = llvm.alloca %[[VAL_2]] x !llvm.array<1024 x i32> {bindc_name = "b", in_type = !fir.array<1024xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEb"} : (i64) -> !llvm.ptr<array<1024 x i32>>
+// CHECK: %[[VAL_3:.*]] = llvm.alloca %[[VAL_2]] x !llvm.array<1024 x i32> {bindc_name = "b", in_type = !fir.array<1024xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEb"} : (i64) -> !llvm.ptr<array<1024 x i32>>
// CHECK: %[[VAL_4:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_5:.*]] = llvm.alloca %[[VAL_4]] x !llvm.array<1024 x i32> {bindc_name = "c", in_type = !fir.array<1024xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEc"} : (i64) -> !llvm.ptr<array<1024 x i32>>
+// CHECK: %[[VAL_5:.*]] = llvm.alloca %[[VAL_4]] x !llvm.array<1024 x i32> {bindc_name = "c", in_type = !fir.array<1024xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEc"} : (i64) -> !llvm.ptr<array<1024 x i32>>
// CHECK: %[[VAL_6:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_7:.*]] = llvm.alloca %[[VAL_6]] x !llvm.array<1024 x i32> {bindc_name = "d", in_type = !fir.array<1024xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEd"} : (i64) -> !llvm.ptr<array<1024 x i32>>
+// CHECK: %[[VAL_7:.*]] = llvm.alloca %[[VAL_6]] x !llvm.array<1024 x i32> {bindc_name = "d", in_type = !fir.array<1024xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_dataEd"} : (i64) -> !llvm.ptr<array<1024 x i32>>
// CHECK: omp.target_enter_data map((to -> %[[VAL_1]] : !llvm.ptr<array<1024 x i32>>), (to -> %[[VAL_3]] : !llvm.ptr<array<1024 x i32>>), (always, alloc -> %[[VAL_5]] : !llvm.ptr<array<1024 x i32>>))
// CHECK: omp.target_exit_data map((from -> %[[VAL_1]] : !llvm.ptr<array<1024 x i32>>), (from -> %[[VAL_3]] : !llvm.ptr<array<1024 x i32>>), (release -> %[[VAL_5]] : !llvm.ptr<array<1024 x i32>>), (always, delete -> %[[VAL_7]] : !llvm.ptr<array<1024 x i32>>))
// CHECK: llvm.return
@@ -278,9 +278,9 @@ func.func @_QPopenmp_target_data_region() {
// CHECK-LABEL: llvm.func @_QPopenmp_target_data_region() {
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<1024 x i32> {bindc_name = "a", in_type = !fir.array<1024xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_data_regionEa"} : (i64) -> !llvm.ptr<array<1024 x i32>>
+// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<1024 x i32> {bindc_name = "a", in_type = !fir.array<1024xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_data_regionEa"} : (i64) -> !llvm.ptr<array<1024 x i32>>
// CHECK: %[[VAL_2:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_3:.*]] = llvm.alloca %[[VAL_2]] x i32 {bindc_name = "i", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_data_regionEi"} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[VAL_3:.*]] = llvm.alloca %[[VAL_2]] x i32 {bindc_name = "i", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_data_regionEi"} : (i64) -> !llvm.ptr<i32>
// CHECK: omp.target_data map((tofrom -> %[[VAL_1]] : !llvm.ptr<array<1024 x i32>>)) {
// CHECK: %[[VAL_4:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: %[[VAL_5:.*]] = llvm.sext %[[VAL_4]] : i32 to i64
@@ -351,7 +351,7 @@ func.func @_QPomp_target() {
// CHECK-LABEL: llvm.func @_QPomp_target() {
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<512 x i32> {bindc_name = "a", in_type = !fir.array<512xi32>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_targetEa"} : (i64) -> !llvm.ptr<array<512 x i32>>
+// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x !llvm.array<512 x i32> {bindc_name = "a", in_type = !fir.array<512xi32>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_targetEa"} : (i64) -> !llvm.ptr<array<512 x i32>>
// CHECK: %[[VAL_2:.*]] = llvm.mlir.constant(64 : i32) : i32
// CHECK: omp.target thread_limit(%[[VAL_2]] : i32) map((tofrom -> %[[VAL_1]] : !llvm.ptr<array<512 x i32>>)) {
// CHECK: %[[VAL_3:.*]] = llvm.mlir.constant(10 : i32) : i32
@@ -557,7 +557,7 @@ func.func @_QPsb() {
// CHECK: llvm.func @_QPsb() {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[LI_REF:.*]] = llvm.alloca %6 x i32 {bindc_name = "li", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFsbEli"} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[LI_REF:.*]] = llvm.alloca %6 x i32 {bindc_name = "li", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFsbEli"} : (i64) -> !llvm.ptr<i32>
// CHECK: omp.sections {
// CHECK: omp.section {
// CHECK: llvm.br ^[[BB_ENTRY:.*]]({{.*}})
@@ -595,7 +595,7 @@ func.func @_QPsb() {
// CHECK: }
// CHECK-LABEL: @_QPsimple_reduction
// CHECK-SAME: %[[ARRAY_REF:.*]]: !llvm.ptr<array<100 x i32>>
-// CHECK: %[[RED_ACCUMULATOR:.*]] = llvm.alloca %2 x i32 {bindc_name = "x", in_type = !fir.logical<4>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[RED_ACCUMULATOR:.*]] = llvm.alloca %2 x i32 {bindc_name = "x", in_type = !fir.logical<4>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr<i32>
// CHECK: omp.parallel {
// CHECK: omp.wsloop reduction(@[[EQV_REDUCTION]] -> %[[RED_ACCUMULATOR]] : !llvm.ptr<i32>) for
// CHECK: %[[ARRAY_ELEM_REF:.*]] = llvm.getelementptr %[[ARRAY_REF]][0, %{{.*}}] : (!llvm.ptr<array<100 x i32>>, i64) -> !llvm.ptr<i32>
diff --git a/flang/test/Fir/convert-to-llvm.fir b/flang/test/Fir/convert-to-llvm.fir
index d0c154fb0376e3..52716afe3198d9 100644
--- a/flang/test/Fir/convert-to-llvm.fir
+++ b/flang/test/Fir/convert-to-llvm.fir
@@ -1748,7 +1748,7 @@ func.func @no_reassoc(%arg0: !fir.ref<i32>) {
// CHECK-LABEL: llvm.func @no_reassoc(
// CHECK-SAME: %[[ARG0:.*]]: !llvm.ptr<i32>) {
// CHECK: %[[C1:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[ALLOC:.*]] = llvm.alloca %[[C1]] x i32 {in_type = i32, operand_segment_sizes = array<i32: 0, 0>} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[ALLOC:.*]] = llvm.alloca %[[C1]] x i32 {in_type = i32, operandSegmentSizes = array<i32: 0, 0>} : (i64) -> !llvm.ptr<i32>
// CHECK: %[[LOAD:.*]] = llvm.load %[[ARG0]] : !llvm.ptr<i32>
// CHECK: llvm.store %[[LOAD]], %[[ALLOC]] : !llvm.ptr<i32>
// CHECK: llvm.return
@@ -1868,7 +1868,7 @@ func.func private @_QPxb(!fir.box<!fir.array<?x?xf64>>)
// CHECK: %[[C1_0:.*]] = llvm.mlir.constant(1 : i64) : i64
// CHECK: %[[ARR_SIZE_TMP1:.*]] = llvm.mul %[[C1_0]], %[[N1]] : i64
// CHECK: %[[ARR_SIZE:.*]] = llvm.mul %[[ARR_SIZE_TMP1]], %[[N2]] : i64
-// CHECK: %[[ARR:.*]] = llvm.alloca %[[ARR_SIZE]] x f64 {bindc_name = "arr", in_type = !fir.array<?x?xf64>, operand_segment_sizes = array<i32: 0, 2>, uniq_name = "_QFsbEarr"} : (i64) -> !llvm.ptr<f64>
+// CHECK: %[[ARR:.*]] = llvm.alloca %[[ARR_SIZE]] x f64 {bindc_name = "arr", in_type = !fir.array<?x?xf64>, operandSegmentSizes = array<i32: 0, 2>, uniq_name = "_QFsbEarr"} : (i64) -> !llvm.ptr<f64>
// CHECK: %[[TYPE_CODE:.*]] = llvm.mlir.constant(28 : i32) : i32
// CHECK: %[[NULL:.*]] = llvm.mlir.null : !llvm.ptr<f64>
// CHECK: %[[GEP:.*]] = llvm.getelementptr %[[NULL]][1]
@@ -1945,9 +1945,9 @@ func.func private @_QPtest_dt_callee(%arg0: !fir.box<!fir.array<?xi32>>)
// CHECK: %[[C10:.*]] = llvm.mlir.constant(10 : i64) : i64
// CHECK: %[[C2:.*]] = llvm.mlir.constant(2 : i64) : i64
// CHECK: %[[ALLOCA_SIZE_V:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[V:.*]] = llvm.alloca %[[ALLOCA_SIZE_V]] x i32 {bindc_name = "v", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFtest_dt_sliceEv"} : (i64) -> !llvm.ptr<i32>
+// CHECK: %[[V:.*]] = llvm.alloca %[[ALLOCA_SIZE_V]] x i32 {bindc_name = "v", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFtest_dt_sliceEv"} : (i64) -> !llvm.ptr<i32>
// CHECK: %[[ALLOCA_SIZE_X:.*]] = llvm.mlir.constant(1 : i64) : i64
-// CHECK: %[[X:.*]] = llvm.alloca %[[ALLOCA_SIZE_X]] x !llvm.array<20 x struct<"_QFtest_dt_sliceTt", (i32, i32)>> {bindc_name = "x", in_type = !fir.array<20x!fir.type<_QFtest_dt_sliceTt{i:i32,j:i32}>>, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFtest_dt_sliceEx"} : (i64) -> !llvm.ptr<array<20 x struct<"_QFtest_dt_sliceTt", (i32, i32)>>>
+// CHECK: %[[X:.*]] = llvm.alloca %[[ALLOCA_SIZE_X]] x !llvm.array<20 x struct<"_QFtest_dt_sliceTt", (i32, i32)>> {bindc_name = "x", in_type = !fir.array<20x!fir.type<_QFtest_dt_sliceTt{i:i32,j:i32}>>, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFtest_dt_sliceEx"} : (i64) -> !llvm.ptr<array<20 x struct<"_QFtest_dt_sliceTt", (i32, i32)>>>
// CHECK: %[[TYPE_CODE:.*]] = llvm.mlir.constant(9 : i32) : i32
// CHECK: %[[NULL:.*]] = llvm.mlir.null : !llvm.ptr<i32>
// CHECK: %[[GEP:.*]] = llvm.getelementptr %[[NULL]][1]
diff --git a/mlir/docs/PatternRewriter.md b/mlir/docs/PatternRewriter.md
index 8428d4ba991efc..8fe5ef35a76039 100644
--- a/mlir/docs/PatternRewriter.md
+++ b/mlir/docs/PatternRewriter.md
@@ -383,7 +383,7 @@ Example output is shown below:
```
//===-------------------------------------------===//
Processing operation : 'cf.cond_br'(0x60f000001120) {
- "cf.cond_br"(%arg0)[^bb2, ^bb2] {operand_segment_sizes = array<i32: 1, 0, 0>} : (i1) -> ()
+ "cf.cond_br"(%arg0)[^bb2, ^bb2] {operandSegmentSizes = array<i32: 1, 0, 0>} : (i1) -> ()
* Pattern SimplifyConstCondBranchPred : 'cf.cond_br -> ()' {
} -> failure : pattern failed to match
diff --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
index e88a80d0793416..250119c89d3a7f 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
@@ -234,7 +234,7 @@ def IRDL_OperandsOp : IRDL_Op<"operands", [HasParent<"OperationOp">]> {
and %3 is a variadic operand.
When more than one operand is marked as optional or variadic, the operation
- will expect a 'operand_segment_sizes' attribute that defines the number of
+ will expect a 'operandSegmentSizes' attribute that defines the number of
operands in each segment.
}];
@@ -280,7 +280,7 @@ def IRDL_ResultsOp : IRDL_Op<"results", [HasParent<"OperationOp">]> {
and %3 is a variadic result.
When more than one result is marked as optional or variadic, the operation
- will expect a 'result_segment_sizes' attribute that defines the number of
+ will expect a 'resultSegmentSizes' attribute that defines the number of
results in each segment.
}];
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
index 1efd2b6b63dd9f..4567b3f1902d72 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -874,23 +874,6 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
return cast<DestinationStyleOpInterface>(*this->getOperation())
.hasTensorSemantics();
}
-
- //========================================================================//
- // Helper functions to mutate the `operand_segment_sizes` attribute.
- // These are useful when cloning and changing operand types.
- //========================================================================//
- void setNumInputs(unsigned num) { setOperandSegmentAt(0, num); }
- void setNumOutputBuffers(unsigned num) { setOperandSegmentAt(1, num); }
-
- private:
- void setOperandSegmentAt(unsigned idx, unsigned val) {
- auto attr = ::llvm::cast<DenseIntElementsAttr>(
- (*this)->getAttr("operand_segment_sizes"));
- unsigned i = 0;
- auto newAttr = attr.mapValues(IntegerType::get(getContext(), 32),
- [&](const APInt &v) { return (i++ == idx) ? APInt(32, val) : v; });
- getOperation()->setAttr("operand_segment_sizes", newAttr);
- }
}];
let verify = [{ return detail::verifyStructuredOpInterface($_op); }];
diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index c18986fe402727..64b776787e863c 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -2178,7 +2178,7 @@ def SameVariadicOperandSize : GenInternalOpTrait<"SameVariadicOperandSize">;
// to have the same array size.
def SameVariadicResultSize : GenInternalOpTrait<"SameVariadicResultSize">;
-// Uses an attribute named `operand_segment_sizes` to specify how many actual
+// Uses an attribute named `operandSegmentSizes` to specify how many actual
// operand each ODS-declared operand (variadic or not) corresponds to.
// This trait is used for ops that have multiple variadic operands but do
// not know statically their size relationship. The attribute must be a 1D
@@ -2188,7 +2188,7 @@ def SameVariadicResultSize : GenInternalOpTrait<"SameVariadicResultSize">;
def AttrSizedOperandSegments :
NativeOpTrait<"AttrSizedOperandSegments">, StructuralOpTrait;
// Similar to AttrSizedOperandSegments, but used for results. The attribute
-// should be named as `result_segment_sizes`.
+// should be named as `resultSegmentSizes`.
def AttrSizedResultSegments :
NativeOpTrait<"AttrSizedResultSegments">, StructuralOpTrait;
diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index d42bffaf32b03a..afbd0395b466a3 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -1331,7 +1331,7 @@ struct HasParent {
/// relationship is not always known statically. For such cases, we need
/// a per-op-instance specification to divide the operands into logical groups
/// or segments. This can be modeled by attributes. The attribute will be named
-/// as `operand_segment_sizes`.
+/// as `operandSegmentSizes`.
///
/// This trait verifies the attribute for specifying operand segments has
/// the correct type (1D vector) and values (non-negative), etc.
@@ -1339,9 +1339,7 @@ template <typename ConcreteType>
class AttrSizedOperandSegments
: public TraitBase<ConcreteType, AttrSizedOperandSegments> {
public:
- static StringRef getOperandSegmentSizeAttr() {
- return "operand_segment_sizes";
- }
+ static StringRef getOperandSegmentSizeAttr() { return "operandSegmentSizes"; }
static LogicalResult verifyTrait(Operation *op) {
return ::mlir::OpTrait::impl::verifyOperandSizeAttr(
@@ -1354,7 +1352,7 @@ template <typename ConcreteType>
class AttrSizedResultSegments
: public TraitBase<ConcreteType, AttrSizedResultSegments> {
public:
- static StringRef getResultSegmentSizeAttr() { return "result_segment_sizes"; }
+ static StringRef getResultSegmentSizeAttr() { return "resultSegmentSizes"; }
static LogicalResult verifyTrait(Operation *op) {
return ::mlir::OpTrait::impl::verifyResultSizeAttr(
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index 6b9de9a8c76cea..d348175b576dc8 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -1675,28 +1675,28 @@ py::object PyOpView::buildGeneric(
} else {
attributes = py::dict();
}
- if (attributes->contains("result_segment_sizes") ||
- attributes->contains("operand_segment_sizes")) {
- throw py::value_error("Manually setting a 'result_segment_sizes' or "
- "'operand_segment_sizes' attribute is unsupported. "
+ if (attributes->contains("resultSegmentSizes") ||
+ attributes->contains("operandSegmentSizes")) {
+ throw py::value_error("Manually setting a 'resultSegmentSizes' or "
+ "'operandSegmentSizes' attribute is unsupported. "
"Use Operation.create for such low-level access.");
}
- // Add result_segment_sizes attribute.
+ // Add resultSegmentSizes attribute.
if (!resultSegmentLengths.empty()) {
MlirAttribute segmentLengthAttr =
mlirDenseI32ArrayGet(context->get(), resultSegmentLengths.size(),
resultSegmentLengths.data());
- (*attributes)["result_segment_sizes"] =
+ (*attributes)["resultSegmentSizes"] =
PyAttribute(context, segmentLengthAttr);
}
- // Add operand_segment_sizes attribute.
+ // Add operandSegmentSizes attribute.
if (!operandSegmentLengths.empty()) {
MlirAttribute segmentLengthAttr =
mlirDenseI32ArrayGet(context->get(), operandSegmentLengths.size(),
operandSegmentLengths.data());
- (*attributes)["operand_segment_sizes"] =
+ (*attributes)["operandSegmentSizes"] =
PyAttribute(context, segmentLengthAttr);
}
}
diff --git a/mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp b/mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
index 9dfe07797ff4b6..e6154a329aaccb 100644
--- a/mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
+++ b/mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
@@ -53,7 +53,7 @@ enum class DataArgAction : unsigned char {
// Fix up the fact that, when we're migrating from a general bugffer atomic
// to a load or to a CAS, the number of openrands, and thus the number of
-// entries needed in operand_segment_sizes, needs to change. We use this method
+// entries needed in operandSegmentSizes, needs to change. We use this method
// because we'd like to preserve unknown attributes on the atomic instead of
// discarding them.
static void patchOperandSegmentSizes(ArrayRef<NamedAttribute> attrs,
@@ -61,7 +61,7 @@ static void patchOperandSegmentSizes(ArrayRef<NamedAttribute> attrs,
DataArgAction action) {
newAttrs.reserve(attrs.size());
for (NamedAttribute attr : attrs) {
- if (attr.getName().getValue() != "operand_segment_sizes") {
+ if (attr.getName().getValue() != "operandSegmentSizes") {
newAttrs.push_back(attr);
continue;
}
diff --git a/mlir/lib/Dialect/Async/IR/Async.cpp b/mlir/lib/Dialect/Async/IR/Async.cpp
index 7d018bf8f3a3df..abe6670c7f855f 100644
--- a/mlir/lib/Dialect/Async/IR/Async.cpp
+++ b/mlir/lib/Dialect/Async/IR/Async.cpp
@@ -61,7 +61,7 @@ YieldOp::getMutableSuccessorOperands(std::optional<unsigned> index) {
/// ExecuteOp
//===----------------------------------------------------------------------===//
-constexpr char kOperandSegmentSizesAttr[] = "operand_segment_sizes";
+constexpr char kOperandSegmentSizesAttr[] = "operandSegmentSizes";
OperandRange
ExecuteOp::getSuccessorEntryOperands(std::optional<unsigned> index) {
@@ -100,7 +100,7 @@ void ExecuteOp::build(OpBuilder &builder, OperationState &result,
result.addOperands(dependencies);
result.addOperands(operands);
- // Add derived `operand_segment_sizes` attribute based on parsed operands.
+ // Add derived `operandSegmentSizes` attribute based on parsed operands.
int32_t numDependencies = dependencies.size();
int32_t numOperands = operands.size();
auto operandSegmentSizes =
@@ -208,7 +208,7 @@ ParseResult ExecuteOp::parse(OpAsmParser &parser, OperationState &result) {
int32_t numOperands = valueArgs.size();
- // Add derived `operand_segment_sizes` attribute based on parsed operands.
+ // Add derived `operandSegmentSizes` attribute based on parsed operands.
auto operandSegmentSizes =
parser.getBuilder().getDenseI32ArrayAttr({numDependencies, numOperands});
result.addAttribute(kOperandSegmentSizesAttr, operandSegmentSizes);
diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index b59ea45e03240b..c19ccfd83017dd 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -170,7 +170,7 @@ static void buildStructuredOp(OpBuilder &b, OperationState &state,
state.addTypes(derivedResultTypes);
state.addAttributes(attributes);
state.addAttribute(
- "operand_segment_sizes",
+ "operandSegmentSizes",
b.getDenseI32ArrayAttr({static_cast<int32_t>(inputs.size()),
static_cast<int32_t>(outputs.size())}));
@@ -226,18 +226,18 @@ parseCommonStructuredOpParts(OpAsmParser &parser, OperationState &result,
// This is a bit complex because we're trying to be backward compatible with
// operation syntax that mix the inherent attributes and the discardable
// ones in the same dictionary. If the properties are used, we append the
- // operand_segment_sizes there directly. Otherwise we append it to the
+ // operandSegmentSizes there directly. Otherwise we append it to the
// discardable attributes dictionary where it is handled by the generic
// Operation::create(...) method.
if (result.propertiesAttr) {
NamedAttrList attrs = llvm::cast<DictionaryAttr>(result.propertiesAttr);
- attrs.append("operand_segment_sizes",
+ attrs.append("operandSegmentSizes",
parser.getBuilder().getDenseI32ArrayAttr(
{static_cast<int32_t>(inputsOperands.size()),
static_cast<int32_t>(outputsOperands.size())}));
result.propertiesAttr = attrs.getDictionary(parser.getContext());
} else {
- result.addAttribute("operand_segment_sizes",
+ result.addAttribute("operandSegmentSizes",
parser.getBuilder().getDenseI32ArrayAttr(
{static_cast<int32_t>(inputsOperands.size()),
static_cast<int32_t>(outputsOperands.size())}));
@@ -332,7 +332,7 @@ static void printNamedStructuredOp(OpAsmPrinter &p, Operation *op,
ValueRange inputs, ValueRange outputs) {
p.printOptionalAttrDict(
op->getAttrs(),
- /*elidedAttrs=*/{"operand_segment_sizes",
+ /*elidedAttrs=*/{"operandSegmentSizes",
// See generated code in
// LinalgNamedStructuredOps.yamlgen.cpp.inc
"linalg.memoized_indexing_maps"});
@@ -900,7 +900,7 @@ void GenericOp::print(OpAsmPrinter &p) {
printCommonStructuredOpParts(p, SmallVector<Value>(getDpsInputOperands()),
SmallVector<Value>(getDpsInitOperands()));
- genericAttrNames.push_back("operand_segment_sizes");
+ genericAttrNames.push_back("operandSegmentSizes");
genericAttrNamesSet.insert(genericAttrNames.back());
bool hasExtraAttrs = false;
diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp
index cfa09b5d4e11de..37e22bbc089f01 100644
--- a/mlir/lib/Dialect/SCF/IR/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -1365,7 +1365,7 @@ ParseResult ForallOp::parse(OpAsmParser &parser, OperationState &result) {
result.addAttribute("staticLowerBound", staticLbs);
result.addAttribute("staticUpperBound", staticUbs);
result.addAttribute("staticStep", staticSteps);
- result.addAttribute("operand_segment_sizes",
+ result.addAttribute("operandSegmentSizes",
parser.getBuilder().getDenseI32ArrayAttr(
{static_cast<int32_t>(dynamicLbs.size()),
static_cast<int32_t>(dynamicUbs.size()),
@@ -1400,7 +1400,7 @@ void ForallOp::build(
result.addAttribute(getStaticStepAttrName(result.name),
b.getDenseI64ArrayAttr(staticSteps));
result.addAttribute(
- "operand_segment_sizes",
+ "operandSegmentSizes",
b.getDenseI32ArrayAttr({static_cast<int32_t>(dynamicLbs.size()),
static_cast<int32_t>(dynamicUbs.size()),
static_cast<int32_t>(dynamicSteps.size()),
@@ -1601,7 +1601,7 @@ struct ForallOpSingleOrZeroIterationDimsFolder
op.getOutputs(), std::nullopt, nullptr);
newOp.getBodyRegion().getBlocks().clear();
// The new loop needs to keep all attributes from the old one, except for
- // "operand_segment_sizes" and static loop bound attributes which capture
+ // "operandSegmentSizes" and static loop bound attributes which capture
// the outdated information of the old iteration domain.
SmallVector<StringAttr> elidedAttrs{newOp.getOperandSegmentSizesAttrName(),
newOp.getStaticLowerBoundAttrName(),
@@ -2833,7 +2833,7 @@ ParseResult ParallelOp::parse(OpAsmParser &parser, OperationState &result) {
if (parser.parseRegion(*body, ivs))
return failure();
- // Set `operand_segment_sizes` attribute.
+ // Set `operandSegmentSizes` attribute.
result.addAttribute(
ParallelOp::getOperandSegmentSizeAttr(),
builder.getDenseI32ArrayAttr({static_cast<int32_t>(lower.size()),
diff --git a/mlir/lib/Rewrite/ByteCode.cpp b/mlir/lib/Rewrite/ByteCode.cpp
index c8c442823781b6..e7d4c4089a991e 100644
--- a/mlir/lib/Rewrite/ByteCode.cpp
+++ b/mlir/lib/Rewrite/ByteCode.cpp
@@ -1846,7 +1846,7 @@ void ByteCodeExecutor::executeGetOperands() {
ByteCodeField rangeIndex = read();
void *result = executeGetOperandsResults<OpTrait::AttrSizedOperandSegments>(
- op->getOperands(), op, index, rangeIndex, "operand_segment_sizes",
+ op->getOperands(), op, index, rangeIndex, "operandSegmentSizes",
valueRangeMemory);
if (!result)
LLVM_DEBUG(llvm::dbgs() << " * Invalid operand range\n");
@@ -1872,7 +1872,7 @@ void ByteCodeExecutor::executeGetResults() {
ByteCodeField rangeIndex = read();
void *result = executeGetOperandsResults<OpTrait::AttrSizedResultSegments>(
- op->getResults(), op, index, rangeIndex, "result_segment_sizes",
+ op->getResults(), op, index, rangeIndex, "resultSegmentSizes",
valueRangeMemory);
if (!result)
LLVM_DEBUG(llvm::dbgs() << " * Invalid result range\n");
diff --git a/mlir/test/Bytecode/operand_segment_sizes.mlir b/mlir/test/Bytecode/operand_segment_sizes.mlir
index 9791bd4e0f264c..c0379c2994f49f 100644
--- a/mlir/test/Bytecode/operand_segment_sizes.mlir
+++ b/mlir/test/Bytecode/operand_segment_sizes.mlir
@@ -2,7 +2,7 @@
func.func @roundtripOperandSizeAttr(%arg0: i32) {
- // CHECK: odsOperandSegmentSizes = array<i32: 0, 2, 1, 1>}>
- "test.attr_sized_operands"(%arg0, %arg0, %arg0, %arg0) <{odsOperandSegmentSizes = array<i32: 0, 2, 1, 1>}> : (i32, i32, i32, i32) -> ()
+ // CHECK: operandSegmentSizes = array<i32: 0, 2, 1, 1>}>
+ "test.attr_sized_operands"(%arg0, %arg0, %arg0, %arg0) <{operandSegmentSizes = array<i32: 0, 2, 1, 1>}> : (i32, i32, i32, i32) -> ()
return
}
diff --git a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
index ab91729a0556b1..b83b122f75e4b0 100644
--- a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
@@ -79,7 +79,7 @@ func.func @wsloop(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4:
// CHECK: "test.payload"(%[[CAST_ARG6]], %[[CAST_ARG7]]) : (index, index) -> ()
"test.payload"(%arg6, %arg7) : (index, index) -> ()
omp.yield
- }) {operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 0, 0>} : (index, index, index, index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 0, 0>} : (index, index, index, index, index, index) -> ()
omp.terminator
}
return
@@ -328,7 +328,7 @@ llvm.func @_QPsimple_reduction(%arg0: !llvm.ptr<array<100 x i32>> {fir.bindc_nam
%5 = llvm.zext %2 : i1 to i32
llvm.store %5, %4 : !llvm.ptr<i32>
omp.parallel {
- %6 = llvm.alloca %3 x i32 {adapt.valuebyref, in_type = i32, operand_segment_sizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
+ %6 = llvm.alloca %3 x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
omp.wsloop reduction(@eqv_reduction -> %4 : !llvm.ptr<i32>) for (%arg1) : i32 = (%1) to (%0) inclusive step (%1) {
llvm.store %arg1, %6 : !llvm.ptr<i32>
%7 = llvm.load %6 : !llvm.ptr<i32>
diff --git a/mlir/test/Dialect/GPU/invalid.mlir b/mlir/test/Dialect/GPU/invalid.mlir
index e20b8376be6093..176ab9527b7850 100644
--- a/mlir/test/Dialect/GPU/invalid.mlir
+++ b/mlir/test/Dialect/GPU/invalid.mlir
@@ -4,7 +4,7 @@ func.func @not_enough_sizes(%sz : index) {
// expected-error at +1 {{expected 6 or more operands, but found 5}}
"gpu.launch"(%sz, %sz, %sz, %sz, %sz) ({
gpu.return
- }) {operand_segment_sizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0>} : (index, index, index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0>} : (index, index, index, index, index) -> ()
return
}
@@ -16,7 +16,7 @@ func.func @no_region_attrs(%sz : index) {
^bb1(%bx: index, %by: index, %bz: index,
%tx: index, %ty: index, %tz: index):
gpu.terminator
- }) {operand_segment_sizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0>} : (index, index, index, index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0>} : (index, index, index, index, index, index) -> ()
return
}
@@ -38,7 +38,7 @@ func.func @launch_requires_gpu_return(%sz : index) {
func.func @launch_func_too_few_operands(%sz : index) {
// expected-error at +1 {{expected 6 or more operands}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz)
- {operand_segment_sizes = array<i32: 0, 1, 1, 1, 1, 1, 0, 0>}
+ {operandSegmentSizes = array<i32: 0, 1, 1, 1, 1, 1, 0, 0>}
: (index, index, index, index, index) -> ()
return
}
@@ -57,7 +57,7 @@ module attributes {gpu.container_module} {
func.func @launch_func_missing_callee_attribute(%sz : index) {
// expected-error at +1 {{'gpu.launch_func' op requires attribute 'kernel'}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz)
- {operand_segment_sizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0, 0>}
+ {operandSegmentSizes = array<i32: 0, 1, 1, 1, 1, 1, 1, 0, 0>}
: (index, index, index, index, index, index) -> ()
return
}
diff --git a/mlir/test/Dialect/LLVMIR/invalid.mlir b/mlir/test/Dialect/LLVMIR/invalid.mlir
index 14141c4c243ab3..cf4697b17aa468 100644
--- a/mlir/test/Dialect/LLVMIR/invalid.mlir
+++ b/mlir/test/Dialect/LLVMIR/invalid.mlir
@@ -887,7 +887,7 @@ func.func @switch_wrong_number_of_weights(%arg0 : i32) {
func.func @switch_case_type_mismatch(%arg0 : i64) {
// expected-error at below {{expects case value type to match condition value type}}
- "llvm.switch"(%arg0)[^bb1, ^bb2] <{case_operand_segments = array<i32: 0>, case_values = dense<42> : vector<1xi32>, odsOperandSegmentSizes = array<i32: 1, 0, 0>}> : (i64) -> ()
+ "llvm.switch"(%arg0)[^bb1, ^bb2] <{case_operand_segments = array<i32: 0>, case_values = dense<42> : vector<1xi32>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i64) -> ()
^bb1: // pred: ^bb0
llvm.return
^bb2: // pred: ^bb0
diff --git a/mlir/test/Dialect/Linalg/named-ops.mlir b/mlir/test/Dialect/Linalg/named-ops.mlir
index 030b86483e1e85..76146b17014ebb 100644
--- a/mlir/test/Dialect/Linalg/named-ops.mlir
+++ b/mlir/test/Dialect/Linalg/named-ops.mlir
@@ -178,7 +178,7 @@ func.func @depthwise_conv_2d_input_nhwc_filter_default_attributes(%input: memref
// -----
func.func @depthwise_conv_2d_input_nhwc_filter_wrong_stride_element_type_properties(%input: memref<1x113x113x96xf32>, %filter: memref<3x3x96xf32>, %output: memref<1x56x56x96xf32>) {
- // expected-error @+1 {{invalid properties {dilations = dense<1> : vector<2xi64>, operand_segment_sizes = array<i32: 2, 1>, strides = dense<2.000000e+00> : vector<2xf32>} for op linalg.depthwise_conv_2d_nhwc_hwc: Invalid attribute `strides` in property conversion: dense<2.000000e+00> : vector<2xf32>}}
+ // expected-error @+1 {{invalid properties {dilations = dense<1> : vector<2xi64>, operandSegmentSizes = array<i32: 2, 1>, strides = dense<2.000000e+00> : vector<2xf32>} for op linalg.depthwise_conv_2d_nhwc_hwc: Invalid attribute `strides` in property conversion: dense<2.000000e+00> : vector<2xf32>}}
linalg.depthwise_conv_2d_nhwc_hwc <{dilations = dense<1> : vector<2xi64>, strides = dense<2.0> : vector<2xf32>}>
ins(%input, %filter: memref<1x113x113x96xf32>, memref<3x3x96xf32>)
outs(%output: memref<1x56x56x96xf32>)
@@ -1100,7 +1100,7 @@ func.func @conv_interface_wrong_input_indexing_map(
%1 = "arith.mulf"(%arg3, %arg4) : (f32, f32) -> f32
%2 = "arith.addf"(%arg5, %1) : (f32, f32) -> f32
"linalg.yield"(%2) : (f32) -> ()
- }) {dilations = dense<1> : tensor<2xi64>, linalg.memoized_indexing_maps = [#map0, #map1, #map2], operand_segment_sizes = array<i32: 2, 1>, strides = dense<2> : tensor<2xi64>} : (tensor<?x?x?x?xf32>, tensor<?x?x?x?xf32>, tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
+ }) {dilations = dense<1> : tensor<2xi64>, linalg.memoized_indexing_maps = [#map0, #map1, #map2], operandSegmentSizes = array<i32: 2, 1>, strides = dense<2> : tensor<2xi64>} : (tensor<?x?x?x?xf32>, tensor<?x?x?x?xf32>, tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
return %0 : tensor<?x?x?x?xf32>
}
@@ -1117,7 +1117,7 @@ func.func @conv_interface_wrong_num_operands(
%1 = "arith.mulf"(%arg3, %arg4) : (f32, f32) -> f32
%2 = "arith.addf"(%arg5, %1) : (f32, f32) -> f32
"linalg.yield"(%2) : (f32) -> ()
- }) {dilations = dense<1> : tensor<2xi64>, linalg.memoized_indexing_maps = [#map0, #map1, #map2], operand_segment_sizes = array<i32: 2, 1>, strides = dense<1> : tensor<2xi64>} : (tensor<?x?x?x?xf32>, tensor<?x?x?x?x?xf32>, tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
+ }) {dilations = dense<1> : tensor<2xi64>, linalg.memoized_indexing_maps = [#map0, #map1, #map2], operandSegmentSizes = array<i32: 2, 1>, strides = dense<1> : tensor<2xi64>} : (tensor<?x?x?x?xf32>, tensor<?x?x?x?x?xf32>, tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
return %0 : tensor<?x?x?x?xf32>
}
diff --git a/mlir/test/Dialect/OpenMP/invalid.mlir b/mlir/test/Dialect/OpenMP/invalid.mlir
index e7bdd0bcf27ab7..5a244ec1bebf23 100644
--- a/mlir/test/Dialect/OpenMP/invalid.mlir
+++ b/mlir/test/Dialect/OpenMP/invalid.mlir
@@ -197,7 +197,7 @@ func.func @omp_simdloop(%lb : index, %ub : index, %step : i32) -> () {
"omp.simdloop" (%lb, %ub, %step) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,0,0,0>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,0,0,0>} :
(index, index, i32) -> ()
return
@@ -225,7 +225,7 @@ func.func @omp_simdloop_aligned_mismatch(%arg0 : index, %arg1 : index,
^bb0(%arg5: index):
"omp.yield"() : () -> ()
}) {alignment_values = [128],
- operand_segment_sizes = array<i32: 1, 1, 1, 2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ operandSegmentSizes = array<i32: 1, 1, 1, 2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -238,7 +238,7 @@ func.func @omp_simdloop_aligned_negative(%arg0 : index, %arg1 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3, %arg4) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {alignment_values = [-1, 128], operand_segment_sizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ }) {alignment_values = [-1, 128], operandSegmentSizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -251,7 +251,7 @@ func.func @omp_simdloop_unexpected_alignment(%arg0 : index, %arg1 : index,
"omp.simdloop"(%arg0, %arg1, %arg2) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {alignment_values = [1, 128], operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 0>} : (index, index, index) -> ()
+ }) {alignment_values = [1, 128], operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 0>} : (index, index, index) -> ()
return
}
@@ -264,7 +264,7 @@ func.func @omp_simdloop_aligned_float(%arg0 : index, %arg1 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3, %arg4) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {alignment_values = [1.5, 128], operand_segment_sizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ }) {alignment_values = [1.5, 128], operandSegmentSizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -277,7 +277,7 @@ func.func @omp_simdloop_aligned_the_same_var(%arg0 : index, %arg1 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3, %arg3) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {alignment_values = [1, 128], operand_segment_sizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ }) {alignment_values = [1, 128], operandSegmentSizes = array<i32: 1, 1, 1,2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -291,7 +291,7 @@ func.func @omp_simdloop_nontemporal_the_same_var(%arg0 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3, %arg3) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 2>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 2>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -1121,7 +1121,7 @@ func.func @omp_teams_allocate(%data_var : memref<i32>) {
// expected-error @below {{expected equal sizes for allocate and allocator variables}}
"omp.teams" (%data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 0,0,0,0,1,0,0>} : (memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 0,0,0,0,1,0,0>} : (memref<i32>) -> ()
omp.terminator
}
return
@@ -1134,7 +1134,7 @@ func.func @omp_teams_num_teams1(%lb : i32) {
// expected-error @below {{expected num_teams upper bound to be defined if the lower bound is defined}}
"omp.teams" (%lb) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,0,0,0,0,0,0>} : (i32) -> ()
+ }) {operandSegmentSizes = array<i32: 1,0,0,0,0,0,0>} : (i32) -> ()
omp.terminator
}
return
@@ -1159,7 +1159,7 @@ func.func @omp_sections(%data_var : memref<i32>) -> () {
// expected-error @below {{expected equal sizes for allocate and allocator variables}}
"omp.sections" (%data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 0,1,0>} : (memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 0,1,0>} : (memref<i32>) -> ()
return
}
@@ -1169,7 +1169,7 @@ func.func @omp_sections(%data_var : memref<i32>) -> () {
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
"omp.sections" (%data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,0,0>} : (memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1,0,0>} : (memref<i32>) -> ()
return
}
@@ -1284,7 +1284,7 @@ func.func @omp_single(%data_var : memref<i32>) -> () {
// expected-error @below {{expected equal sizes for allocate and allocator variables}}
"omp.single" (%data_var) ({
omp.barrier
- }) {operand_segment_sizes = array<i32: 1,0>} : (memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1,0>} : (memref<i32>) -> ()
return
}
@@ -1294,7 +1294,7 @@ func.func @omp_task_depend(%data_var: memref<i32>) {
// expected-error @below {{op expected as many depend values as depend variables}}
"omp.task"(%data_var) ({
"omp.terminator"() : () -> ()
- }) {depends = [], operand_segment_sizes = array<i32: 0, 0, 0, 0, 1, 0, 0>} : (memref<i32>) -> ()
+ }) {depends = [], operandSegmentSizes = array<i32: 0, 0, 0, 0, 1, 0, 0>} : (memref<i32>) -> ()
"func.return"() : () -> ()
}
@@ -1486,7 +1486,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
"omp.taskloop"(%lb, %ub, %ub, %lb, %step, %step, %testmemref) ({
^bb0(%arg3: i32, %arg4: i32):
"omp.terminator"() : () -> ()
- }) {operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, memref<i32>) -> ()
return
}
@@ -1499,7 +1499,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
"omp.taskloop"(%lb, %ub, %ub, %lb, %step, %step, %testf32, %testf32_2) ({
^bb0(%arg3: i32, %arg4: i32):
"omp.terminator"() : () -> ()
- }) {operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0>, reductions = [@add_f32]} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>, !llvm.ptr<f32>) -> ()
+ }) {operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0>, reductions = [@add_f32]} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>, !llvm.ptr<f32>) -> ()
return
}
@@ -1512,7 +1512,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
"omp.taskloop"(%lb, %ub, %ub, %lb, %step, %step, %testf32) ({
^bb0(%arg3: i32, %arg4: i32):
"omp.terminator"() : () -> ()
- }) {operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0>, reductions = [@add_f32, @add_f32]} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>) -> ()
+ }) {operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0>, reductions = [@add_f32, @add_f32]} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>) -> ()
return
}
@@ -1525,7 +1525,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
"omp.taskloop"(%lb, %ub, %ub, %lb, %step, %step, %testf32, %testf32_2) ({
^bb0(%arg3: i32, %arg4: i32):
"omp.terminator"() : () -> ()
- }) {in_reductions = [@add_f32], operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>, !llvm.ptr<f32>) -> ()
+ }) {in_reductions = [@add_f32], operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>, !llvm.ptr<f32>) -> ()
return
}
@@ -1538,7 +1538,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
"omp.taskloop"(%lb, %ub, %ub, %lb, %step, %step, %testf32_2) ({
^bb0(%arg3: i32, %arg4: i32):
"omp.terminator"() : () -> ()
- }) {in_reductions = [@add_f32, @add_f32], operand_segment_sizes = array<i32: 2, 2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>) -> ()
+ }) {in_reductions = [@add_f32, @add_f32], operandSegmentSizes = array<i32: 2, 2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0>} : (i32, i32, i32, i32, i32, i32, !llvm.ptr<f32>) -> ()
return
}
diff --git a/mlir/test/Dialect/OpenMP/ops.mlir b/mlir/test/Dialect/OpenMP/ops.mlir
index 2f0d224a3fef7e..be59defd27d035 100644
--- a/mlir/test/Dialect/OpenMP/ops.mlir
+++ b/mlir/test/Dialect/OpenMP/ops.mlir
@@ -59,7 +59,7 @@ func.func @omp_parallel(%data_var : memref<i32>, %if_cond : i1, %num_threads : i
// CHECK: omp.parallel num_threads(%{{.*}} : i32) allocate(%{{.*}} : memref<i32> -> %{{.*}} : memref<i32>)
"omp.parallel"(%num_threads, %data_var, %data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 0,1,1,1,0>} : (i32, memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 0,1,1,1,0>} : (i32, memref<i32>, memref<i32>) -> ()
// CHECK: omp.barrier
omp.barrier
@@ -68,22 +68,22 @@ func.func @omp_parallel(%data_var : memref<i32>, %if_cond : i1, %num_threads : i
// CHECK: omp.parallel if(%{{.*}}) allocate(%{{.*}} : memref<i32> -> %{{.*}} : memref<i32>)
"omp.parallel"(%if_cond, %data_var, %data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,0,1,1,0>} : (i1, memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1,0,1,1,0>} : (i1, memref<i32>, memref<i32>) -> ()
// test without allocate
// CHECK: omp.parallel if(%{{.*}}) num_threads(%{{.*}} : i32)
"omp.parallel"(%if_cond, %num_threads) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,1,0,0,0>} : (i1, i32) -> ()
+ }) {operandSegmentSizes = array<i32: 1,1,0,0,0>} : (i1, i32) -> ()
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,1,1,1,0>, proc_bind_val = #omp<procbindkind spread>} : (i1, i32, memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1,1,1,1,0>, proc_bind_val = #omp<procbindkind spread>} : (i1, i32, memref<i32>, memref<i32>) -> ()
// test with multiple parameters for single variadic argument
// CHECK: omp.parallel allocate(%{{.*}} : memref<i32> -> %{{.*}} : memref<i32>)
"omp.parallel" (%data_var, %data_var) ({
omp.terminator
- }) {operand_segment_sizes = array<i32: 0,0,1,1,0>} : (memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 0,0,1,1,0>} : (memref<i32>, memref<i32>) -> ()
return
}
@@ -141,7 +141,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
"omp.wsloop" (%lb, %ub, %step) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,0,0,0,0>, ordered_val = 1} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,0,0,0,0>, ordered_val = 1} :
(index, index, index) -> ()
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) schedule(static)
@@ -149,7 +149,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
"omp.wsloop" (%lb, %ub, %step, %data_var, %linear_var) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,1,1,0,0>, schedule_val = #omp<schedulekind static>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,1,1,0,0>, schedule_val = #omp<schedulekind static>} :
(index, index, index, memref<i32>, i32) -> ()
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>, %{{.*}} = %{{.*}} : memref<i32>) schedule(static)
@@ -157,7 +157,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
"omp.wsloop" (%lb, %ub, %step, %data_var, %data_var, %linear_var, %linear_var) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,2,2,0,0>, schedule_val = #omp<schedulekind static>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,2,2,0,0>, schedule_val = #omp<schedulekind static>} :
(index, index, index, memref<i32>, memref<i32>, i32, i32) -> ()
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) schedule(dynamic = %{{.*}}) ordered(2)
@@ -165,7 +165,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
"omp.wsloop" (%lb, %ub, %step, %data_var, %linear_var, %chunk_var) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,1,1,0,1>, schedule_val = #omp<schedulekind dynamic>, ordered_val = 2} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,1,1,0,1>, schedule_val = #omp<schedulekind dynamic>, ordered_val = 2} :
(index, index, index, memref<i32>, i32, i32) -> ()
// CHECK: omp.wsloop schedule(auto) nowait
@@ -173,7 +173,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
"omp.wsloop" (%lb, %ub, %step) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,0,0,0,0>, nowait, schedule_val = #omp<schedulekind auto>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,0,0,0,0>, nowait, schedule_val = #omp<schedulekind auto>} :
(index, index, index) -> ()
return
@@ -333,7 +333,7 @@ func.func @omp_simdloop(%lb : index, %ub : index, %step : index) -> () {
"omp.simdloop" (%lb, %ub, %step) ({
^bb0(%iv: index):
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,0,0,0>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,0,0,0>} :
(index, index, index) -> ()
return
@@ -349,7 +349,7 @@ func.func @omp_simdloop_aligned_list(%arg0 : index, %arg1 : index, %arg2 : index
^bb0(%arg5: index):
"omp.yield"() : () -> ()
}) {alignment_values = [32, 128],
- operand_segment_sizes = array<i32: 1, 1, 1, 2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
+ operandSegmentSizes = array<i32: 1, 1, 1, 2, 0, 0>} : (index, index, index, memref<i32>, memref<i32>) -> ()
return
}
@@ -362,7 +362,7 @@ func.func @omp_simdloop_aligned_single(%arg0 : index, %arg1 : index, %arg2 : ind
^bb0(%arg5: index):
"omp.yield"() : () -> ()
}) {alignment_values = [32],
- operand_segment_sizes = array<i32: 1, 1, 1, 1, 0, 0>} : (index, index, index, memref<i32>) -> ()
+ operandSegmentSizes = array<i32: 1, 1, 1, 1, 0, 0>} : (index, index, index, memref<i32>) -> ()
return
}
@@ -377,7 +377,7 @@ func.func @omp_simdloop_nontemporal_list(%arg0 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3, %arg4) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 2>} : (index, index, index, memref<i32>, memref<i64>) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 2>} : (index, index, index, memref<i32>, memref<i64>) -> ()
return
}
@@ -392,7 +392,7 @@ func.func @omp_simdloop_nontemporal_single(%arg0 : index,
"omp.simdloop"(%arg0, %arg1, %arg2, %arg3) ({
^bb0(%arg5: index):
"omp.yield"() : () -> ()
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 1>} : (index, index, index, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 1>} : (index, index, index, memref<i32>) -> ()
return
}
@@ -487,7 +487,7 @@ func.func @omp_target(%if_cond : i1, %device : si32, %num_threads : i32, %map1:
"omp.target"(%if_cond, %device, %num_threads) ({
// CHECK: omp.terminator
omp.terminator
- }) {nowait, operand_segment_sizes = array<i32: 1,1,1,0>} : ( i1, si32, i32 ) -> ()
+ }) {nowait, operandSegmentSizes = array<i32: 1,1,1,0>} : ( i1, si32, i32 ) -> ()
// Test with optional map clause.
// CHECK: omp.target map((tofrom -> %{{.*}} : memref<?xi32>), (alloc -> %{{.*}} : memref<?xi32>)) {
@@ -1428,13 +1428,13 @@ func.func @omp_sectionsop(%data_var1 : memref<i32>, %data_var2 : memref<i32>,
"omp.sections" (%data_var1, %data_var1) ({
// CHECK: omp.terminator
omp.terminator
- }) {operand_segment_sizes = array<i32: 0,1,1>} : (memref<i32>, memref<i32>) -> ()
+ }) {operandSegmentSizes = array<i32: 0,1,1>} : (memref<i32>, memref<i32>) -> ()
// CHECK: omp.sections reduction(@add_f32 -> %{{.*}} : !llvm.ptr<f32>)
"omp.sections" (%redn_var) ({
// CHECK: omp.terminator
omp.terminator
- }) {operand_segment_sizes = array<i32: 1,0,0>, reductions=[@add_f32]} : (!llvm.ptr<f32>) -> ()
+ }) {operandSegmentSizes = array<i32: 1,0,0>, reductions=[@add_f32]} : (!llvm.ptr<f32>) -> ()
// CHECK: omp.sections nowait {
omp.sections nowait {
diff --git a/mlir/test/Dialect/PDL/invalid.mlir b/mlir/test/Dialect/PDL/invalid.mlir
index c76bc9dcad72da..c6b7fe1cc17898 100644
--- a/mlir/test/Dialect/PDL/invalid.mlir
+++ b/mlir/test/Dialect/PDL/invalid.mlir
@@ -122,7 +122,7 @@ pdl.pattern : benefit(1) {
// expected-error at below {{expected the same number of attribute values and attribute names, got 1 names and 0 values}}
%op = "pdl.operation"() {
attributeValueNames = ["attr"],
- operand_segment_sizes = array<i32: 0, 0, 0>
+ operandSegmentSizes = array<i32: 0, 0, 0>
} : () -> (!pdl.operation)
rewrite %op with "rewriter"
}
@@ -230,7 +230,7 @@ pdl.pattern : benefit(1) {
// expected-error at below {{expected no replacement values to be provided when the replacement operation is present}}
"pdl.replace"(%root, %newOp, %newResult) {
- operand_segment_sizes = array<i32: 1, 1, 1>
+ operandSegmentSizes = array<i32: 1, 1, 1>
} : (!pdl.operation, !pdl.operation, !pdl.value) -> ()
}
}
@@ -276,7 +276,7 @@ pdl.pattern : benefit(1) {
// expected-error at below {{expected rewrite region to be non-empty if external name is not specified}}
"pdl.rewrite"(%op) ({}) {
- operand_segment_sizes = array<i32: 1,0>
+ operandSegmentSizes = array<i32: 1,0>
} : (!pdl.operation) -> ()
}
@@ -289,7 +289,7 @@ pdl.pattern : benefit(1) {
"pdl.rewrite"(%op, %op) ({
^bb1:
}) {
- operand_segment_sizes = array<i32: 1, 1>
+ operandSegmentSizes = array<i32: 1, 1>
}: (!pdl.operation, !pdl.operation) -> ()
}
@@ -303,7 +303,7 @@ pdl.pattern : benefit(1) {
^bb1:
}) {
name = "foo",
- operand_segment_sizes = array<i32: 1,0>
+ operandSegmentSizes = array<i32: 1,0>
} : (!pdl.operation) -> ()
}
diff --git a/mlir/test/Dialect/PDLInterp/invalid.mlir b/mlir/test/Dialect/PDLInterp/invalid.mlir
index 0457a158430a22..c201dda71ef7fb 100644
--- a/mlir/test/Dialect/PDLInterp/invalid.mlir
+++ b/mlir/test/Dialect/PDLInterp/invalid.mlir
@@ -19,7 +19,7 @@ pdl_interp.func @rewriter() {
inferredResultTypes,
inputAttributeNames = [],
name = "foo.op",
- operand_segment_sizes = array<i32: 0, 0, 1>
+ operandSegmentSizes = array<i32: 0, 0, 1>
} : (!pdl.type) -> (!pdl.operation)
pdl_interp.finalize
}
diff --git a/mlir/test/Dialect/SCF/invalid.mlir b/mlir/test/Dialect/SCF/invalid.mlir
index 8566943ef80124..0ff3eaadc8fecd 100644
--- a/mlir/test/Dialect/SCF/invalid.mlir
+++ b/mlir/test/Dialect/SCF/invalid.mlir
@@ -139,7 +139,7 @@ func.func @parallel_body_arguments_wrong_type(
"scf.parallel"(%arg0, %arg1, %arg2) ({
^bb0(%i0: f32):
scf.yield
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0>}: (index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0>}: (index, index, index) -> ()
return
}
@@ -151,7 +151,7 @@ func.func @parallel_body_wrong_number_of_arguments(
"scf.parallel"(%arg0, %arg1, %arg2) ({
^bb0(%i0: index, %i1: index):
scf.yield
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0>}: (index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0>}: (index, index, index) -> ()
return
}
@@ -689,7 +689,7 @@ func.func @parallel_missing_terminator(%0 : index) {
^bb0(%arg1: index):
// expected-note @below {{terminator here}}
%2 = "arith.constant"() {value = 1.000000e+00 : f32} : () -> f32
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0>} : (index, index, index) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0>} : (index, index, index) -> ()
return
}
diff --git a/mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir b/mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir
index af3f3ea2889f7c..8496448759f0c9 100644
--- a/mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir
+++ b/mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir
@@ -117,7 +117,7 @@ func.func @wrong_condition_type() -> () {
func.func @wrong_accessor_count() -> () {
%true = spirv.Constant true
// expected-error @+1 {{requires 2 successors but found 1}}
- "spirv.BranchConditional"(%true)[^one] {operand_segment_sizes = array<i32: 1, 0, 0>} : (i1) -> ()
+ "spirv.BranchConditional"(%true)[^one] {operandSegmentSizes = array<i32: 1, 0, 0>} : (i1) -> ()
^one:
spirv.Return
^two:
@@ -130,7 +130,7 @@ func.func @wrong_number_of_weights() -> () {
%true = spirv.Constant true
// expected-error @+1 {{must have exactly two branch weights}}
"spirv.BranchConditional"(%true)[^one, ^two] {branch_weights = [1 : i32, 2 : i32, 3 : i32],
- operand_segment_sizes = array<i32: 1, 0, 0>} : (i1) -> ()
+ operandSegmentSizes = array<i32: 1, 0, 0>} : (i1) -> ()
^one:
spirv.Return
^two:
diff --git a/mlir/test/Dialect/Transform/ops-invalid.mlir b/mlir/test/Dialect/Transform/ops-invalid.mlir
index c72af7363f67ff..3e30947769eb40 100644
--- a/mlir/test/Dialect/Transform/ops-invalid.mlir
+++ b/mlir/test/Dialect/Transform/ops-invalid.mlir
@@ -76,7 +76,7 @@ transform.sequence failures(propagate) {
"transform.sequence"(%0) ({
^bb0(%arg0: !transform.any_op):
"transform.yield"() : () -> ()
-}) {failure_propagation_mode = 1 : i32, operand_segment_sizes = array<i32: 0, 1>} : (!transform.any_op) -> ()
+}) {failure_propagation_mode = 1 : i32, operandSegmentSizes = array<i32: 0, 1>} : (!transform.any_op) -> ()
// -----
diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir
index 66c9adca8f98ce..0193fae37af7f7 100644
--- a/mlir/test/IR/parser.mlir
+++ b/mlir/test/IR/parser.mlir
@@ -460,7 +460,7 @@ func.func @verbose_terminators() -> (i1, i17) {
^bb1(%x : i1, %y : i17):
// CHECK: cf.cond_br %{{.*}}, ^bb2(%{{.*}} : i17), ^bb3(%{{.*}}, %{{.*}} : i1, i17)
- "cf.cond_br"(%x, %y, %x, %y) [^bb2, ^bb3] {operand_segment_sizes = array<i32: 1, 1, 2>} : (i1, i17, i1, i17) -> ()
+ "cf.cond_br"(%x, %y, %x, %y) [^bb2, ^bb3] {operandSegmentSizes = array<i32: 1, 1, 2>} : (i1, i17, i1, i17) -> ()
^bb2(%a : i17):
%true = arith.constant true
diff --git a/mlir/test/IR/traits.mlir b/mlir/test/IR/traits.mlir
index 7d922ecf67de5d..0402ebe7587508 100644
--- a/mlir/test/IR/traits.mlir
+++ b/mlir/test/IR/traits.mlir
@@ -383,101 +383,101 @@ func.func private @foo()
// -----
func.func @failedMissingOperandSizeAttr(%arg: i32) {
- // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operand_segment_sizes'}}
+ // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operandSegmentSizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) : (i32, i32, i32, i32) -> ()
}
// -----
func.func @failedOperandSizeAttrWrongType(%arg: i32) {
- // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operand_segment_sizes'}}
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = 10} : (i32, i32, i32, i32) -> ()
+ // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operandSegmentSizes'}}
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = 10} : (i32, i32, i32, i32) -> ()
}
// -----
func.func @failedOperandSizeAttrWrongElementType(%arg: i32) {
- // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operand_segment_sizes'}}
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = array<i64: 1, 1, 1, 1>} : (i32, i32, i32, i32) -> ()
+ // expected-error @+1 {{op operand count (4) does not match with the total size (0) specified in attribute 'operandSegmentSizes'}}
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = array<i64: 1, 1, 1, 1>} : (i32, i32, i32, i32) -> ()
}
// -----
func.func @failedOperandSizeAttrNegativeValue(%arg: i32) {
- // expected-error @+1 {{'operand_segment_sizes' attribute cannot have negative elements}}
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = array<i32: 1, 1, -1, 1>} : (i32, i32, i32, i32) -> ()
+ // expected-error @+1 {{'operandSegmentSizes' attribute cannot have negative elements}}
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = array<i32: 1, 1, -1, 1>} : (i32, i32, i32, i32) -> ()
}
// -----
func.func @failedOperandSizeAttrWrongTotalSize(%arg: i32) {
- // expected-error @+1 {{operand count (4) does not match with the total size (3) specified in attribute 'operand_segment_sizes'}}
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = array<i32: 0, 1, 1, 1>} : (i32, i32, i32, i32) -> ()
+ // expected-error @+1 {{operand count (4) does not match with the total size (3) specified in attribute 'operandSegmentSizes'}}
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = array<i32: 0, 1, 1, 1>} : (i32, i32, i32, i32) -> ()
}
// -----
func.func @failedOperandSizeAttrWrongCount(%arg: i32) {
- // expected-error @+1 {{test.attr_sized_operands' op operand count (4) does not match with the total size (0) specified in attribute 'operand_segment_sizes}}
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = array<i32: 2, 1, 1>} : (i32, i32, i32, i32) -> ()
+ // expected-error @+1 {{test.attr_sized_operands' op operand count (4) does not match with the total size (0) specified in attribute 'operandSegmentSizes}}
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = array<i32: 2, 1, 1>} : (i32, i32, i32, i32) -> ()
}
// -----
func.func @succeededOperandSizeAttr(%arg: i32) {
// CHECK: test.attr_sized_operands
- "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = array<i32: 0, 2, 1, 1>} : (i32, i32, i32, i32) -> ()
+ "test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operandSegmentSizes = array<i32: 0, 2, 1, 1>} : (i32, i32, i32, i32) -> ()
return
}
// -----
func.func @failedMissingResultSizeAttr() {
- // expected-error @+1 {{op result count (4) does not match with the total size (0) specified in attribute 'result_segment_sizes'}}
+ // expected-error @+1 {{op result count (4) does not match with the total size (0) specified in attribute 'resultSegmentSizes'}}
%0:4 = "test.attr_sized_results"() : () -> (i32, i32, i32, i32)
}
// -----
func.func @failedResultSizeAttrWrongType() {
- // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'result_segment_sizes'}}
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = 10} : () -> (i32, i32, i32, i32)
+ // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'resultSegmentSizes'}}
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = 10} : () -> (i32, i32, i32, i32)
}
// -----
func.func @failedResultSizeAttrWrongElementType() {
- // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'result_segment_sizes'}}
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = array<i64: 1, 1, 1, 1>} : () -> (i32, i32, i32, i32)
+ // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'resultSegmentSizes'}}
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = array<i64: 1, 1, 1, 1>} : () -> (i32, i32, i32, i32)
}
// -----
func.func @failedResultSizeAttrNegativeValue() {
- // expected-error @+1 {{'result_segment_sizes' attribute cannot have negative elements}}
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = array<i32: 1, 1, -1, 1>} : () -> (i32, i32, i32, i32)
+ // expected-error @+1 {{'resultSegmentSizes' attribute cannot have negative elements}}
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = array<i32: 1, 1, -1, 1>} : () -> (i32, i32, i32, i32)
}
// -----
func.func @failedResultSizeAttrWrongTotalSize() {
- // expected-error @+1 {{result count (4) does not match with the total size (3) specified in attribute 'result_segment_sizes'}}
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = array<i32: 0, 1, 1, 1>} : () -> (i32, i32, i32, i32)
+ // expected-error @+1 {{result count (4) does not match with the total size (3) specified in attribute 'resultSegmentSizes'}}
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = array<i32: 0, 1, 1, 1>} : () -> (i32, i32, i32, i32)
}
// -----
func.func @failedResultSizeAttrWrongCount() {
- // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'result_segment_sizes'}}
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = array<i32: 2, 1, 1>} : () -> (i32, i32, i32, i32)
+ // expected-error @+1 {{ op result count (4) does not match with the total size (0) specified in attribute 'resultSegmentSizes'}}
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = array<i32: 2, 1, 1>} : () -> (i32, i32, i32, i32)
}
// -----
func.func @succeededResultSizeAttr() {
// CHECK: test.attr_sized_results
- %0:4 = "test.attr_sized_results"() {result_segment_sizes = array<i32: 0, 2, 1, 1>} : () -> (i32, i32, i32, i32)
+ %0:4 = "test.attr_sized_results"() {resultSegmentSizes = array<i32: 0, 2, 1, 1>} : () -> (i32, i32, i32, i32)
return
}
diff --git a/mlir/test/Rewrite/pdl-bytecode.mlir b/mlir/test/Rewrite/pdl-bytecode.mlir
index 57bec8ce370736..513ff3c40bc64f 100644
--- a/mlir/test/Rewrite/pdl-bytecode.mlir
+++ b/mlir/test/Rewrite/pdl-bytecode.mlir
@@ -1093,7 +1093,7 @@ module @patterns {
// CHECK-NEXT: "test.success"(%[[INPUTS]]#4) : (i32) -> ()
module @ir attributes { test.get_operands_2 } {
%inputs:5 = "test.producer"() : () -> (i32, i32, i32, i32, i32)
- "test.attr_sized_operands"(%inputs#0, %inputs#1, %inputs#2, %inputs#3, %inputs#4) {operand_segment_sizes = array<i32: 0, 4, 1, 0>} : (i32, i32, i32, i32, i32) -> ()
+ "test.attr_sized_operands"(%inputs#0, %inputs#1, %inputs#2, %inputs#3, %inputs#4) {operandSegmentSizes = array<i32: 0, 4, 1, 0>} : (i32, i32, i32, i32, i32) -> ()
}
// -----
@@ -1246,7 +1246,7 @@ module @patterns {
// CHECK: %[[RESULTS_2_SINGLE:.*]] = "test.success"() : () -> i32
// CHECK: "test.consumer"(%[[RESULTS_1]]#0, %[[RESULTS_1]]#1, %[[RESULTS_1]]#2, %[[RESULTS_1]]#3, %[[RESULTS_2]]) : (i32, i32, i32, i32, i32) -> ()
module @ir attributes { test.get_results_2 } {
- %results:5 = "test.attr_sized_results"() {result_segment_sizes = array<i32: 0, 4, 1, 0>} : () -> (i32, i32, i32, i32, i32)
+ %results:5 = "test.attr_sized_results"() {resultSegmentSizes = array<i32: 0, 4, 1, 0>} : () -> (i32, i32, i32, i32, i32)
"test.consumer"(%results#0, %results#1, %results#2, %results#3, %results#4) : (i32, i32, i32, i32, i32) -> ()
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-llvm.mlir
index 0a6dedc754857b..4d92ce4cb6a1f3 100644
--- a/mlir/test/Target/LLVMIR/omptarget-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-llvm.mlir
@@ -2,7 +2,7 @@
llvm.func @_QPopenmp_target_data() {
%0 = llvm.mlir.constant(1 : i64) : i64
- %1 = llvm.alloca %0 x i32 {bindc_name = "i", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_dataEi"} : (i64) -> !llvm.ptr<i32>
+ %1 = llvm.alloca %0 x i32 {bindc_name = "i", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFopenmp_target_dataEi"} : (i64) -> !llvm.ptr<i32>
omp.target_data map((tofrom -> %1 : !llvm.ptr<i32>)) {
%2 = llvm.mlir.constant(99 : i32) : i32
llvm.store %2, %1 : !llvm.ptr<i32>
@@ -79,9 +79,9 @@ llvm.func @_QPopenmp_target_data_region(%1 : !llvm.ptr<array<1024 x i32>>) {
llvm.func @_QPomp_target_enter_exit(%1 : !llvm.ptr<array<1024 x i32>>, %3 : !llvm.ptr<array<512 x i32>>) {
%4 = llvm.mlir.constant(1 : i64) : i64
- %5 = llvm.alloca %4 x i32 {bindc_name = "dvc", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_enter_exitEdvc"} : (i64) -> !llvm.ptr<i32>
+ %5 = llvm.alloca %4 x i32 {bindc_name = "dvc", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_enter_exitEdvc"} : (i64) -> !llvm.ptr<i32>
%6 = llvm.mlir.constant(1 : i64) : i64
- %7 = llvm.alloca %6 x i32 {bindc_name = "i", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_enter_exitEi"} : (i64) -> !llvm.ptr<i32>
+ %7 = llvm.alloca %6 x i32 {bindc_name = "i", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_enter_exitEi"} : (i64) -> !llvm.ptr<i32>
%8 = llvm.mlir.constant(5 : i32) : i32
llvm.store %8, %7 : !llvm.ptr<i32>
%9 = llvm.mlir.constant(2 : i32) : i32
diff --git a/mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir
index 2ab09f715b2c8d..ce50706a550891 100644
--- a/mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir
@@ -5,11 +5,11 @@ module attributes {omp.is_target_device = true} {
%0 = llvm.mlir.constant(20 : i32) : i32
%1 = llvm.mlir.constant(10 : i32) : i32
%2 = llvm.mlir.constant(1 : i64) : i64
- %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
+ %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
%4 = llvm.mlir.constant(1 : i64) : i64
- %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
+ %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
%6 = llvm.mlir.constant(1 : i64) : i64
- %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
+ %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
llvm.store %1, %3 : !llvm.ptr<i32>
llvm.store %0, %5 : !llvm.ptr<i32>
omp.target {
diff --git a/mlir/test/Target/LLVMIR/omptarget-region-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-region-llvm.mlir
index e130f96af79f75..9ba083d5137d88 100644
--- a/mlir/test/Target/LLVMIR/omptarget-region-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-region-llvm.mlir
@@ -5,11 +5,11 @@ module attributes {omp.is_target_device = false} {
%0 = llvm.mlir.constant(20 : i32) : i32
%1 = llvm.mlir.constant(10 : i32) : i32
%2 = llvm.mlir.constant(1 : i64) : i64
- %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
+ %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
%4 = llvm.mlir.constant(1 : i64) : i64
- %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
+ %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
%6 = llvm.mlir.constant(1 : i64) : i64
- %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
+ %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
llvm.store %1, %3 : !llvm.ptr<i32>
llvm.store %0, %5 : !llvm.ptr<i32>
omp.target {
diff --git a/mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir
index cfa8039c94ba2d..7f5e79db9bcd65 100644
--- a/mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir
@@ -5,11 +5,11 @@ module attributes {omp.is_target_device = false} {
%0 = llvm.mlir.constant(20 : i32) : i32
%1 = llvm.mlir.constant(10 : i32) : i32
%2 = llvm.mlir.constant(1 : i64) : i64
- %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
+ %3 = llvm.alloca %2 x i32 {bindc_name = "a", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEa"} : (i64) -> !llvm.ptr<i32>
%4 = llvm.mlir.constant(1 : i64) : i64
- %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
+ %5 = llvm.alloca %4 x i32 {bindc_name = "b", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEb"} : (i64) -> !llvm.ptr<i32>
%6 = llvm.mlir.constant(1 : i64) : i64
- %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
+ %7 = llvm.alloca %6 x i32 {bindc_name = "c", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFomp_target_regionEc"} : (i64) -> !llvm.ptr<i32>
llvm.store %1, %3 : !llvm.ptr<i32>
llvm.store %0, %5 : !llvm.ptr<i32>
omp.target {
diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
index 41ff6e156e965e..2a76164ffdd2e0 100644
--- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
@@ -310,7 +310,7 @@ llvm.func @wsloop_simple(%arg0: !llvm.ptr<f32>) {
llvm.store %3, %4 : !llvm.ptr<f32>
omp.yield
// CHECK: call void @__kmpc_for_static_fini(ptr @[[$loc_struct]],
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
omp.terminator
}
llvm.return
@@ -330,7 +330,7 @@ llvm.func @wsloop_inclusive_1(%arg0: !llvm.ptr<f32>) {
%4 = llvm.getelementptr %arg0[%arg1] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32>
llvm.store %3, %4 : !llvm.ptr<f32>
omp.yield
- }) {operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
+ }) {operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
llvm.return
}
@@ -348,7 +348,7 @@ llvm.func @wsloop_inclusive_2(%arg0: !llvm.ptr<f32>) {
%4 = llvm.getelementptr %arg0[%arg1] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32>
llvm.store %3, %4 : !llvm.ptr<f32>
omp.yield
- }) {inclusive, operand_segment_sizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
+ }) {inclusive, operandSegmentSizes = array<i32: 1, 1, 1, 0, 0, 0, 0>} : (i64, i64, i64) -> ()
llvm.return
}
@@ -628,7 +628,7 @@ llvm.func @simdloop_simple(%lb : i64, %ub : i64, %step : i64, %arg0: !llvm.ptr<f
%4 = llvm.getelementptr %arg0[%iv] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32>
llvm.store %3, %4 : !llvm.ptr<f32>
omp.yield
- }) {operand_segment_sizes = array<i32: 1,1,1,0,0,0>} :
+ }) {operandSegmentSizes = array<i32: 1,1,1,0,0,0>} :
(i64, i64, i64) -> ()
llvm.return
@@ -733,9 +733,9 @@ llvm.func @simdloop_simple_multiple_simdlen_safelen(%lb1 : i64, %ub1 : i64, %ste
// CHECK-LABEL: @simdloop_if
llvm.func @simdloop_if(%arg0: !llvm.ptr<i32> {fir.bindc_name = "n"}, %arg1: !llvm.ptr<i32> {fir.bindc_name = "threshold"}) {
%0 = llvm.mlir.constant(1 : i64) : i64
- %1 = llvm.alloca %0 x i32 {adapt.valuebyref, in_type = i32, operand_segment_sizes = array<i32: 0, 0>} : (i64) -> !llvm.ptr<i32>
+ %1 = llvm.alloca %0 x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>} : (i64) -> !llvm.ptr<i32>
%2 = llvm.mlir.constant(1 : i64) : i64
- %3 = llvm.alloca %2 x i32 {bindc_name = "i", in_type = i32, operand_segment_sizes = array<i32: 0, 0>, uniq_name = "_QFtest_simdEi"} : (i64) -> !llvm.ptr<i32>
+ %3 = llvm.alloca %2 x i32 {bindc_name = "i", in_type = i32, operandSegmentSizes = array<i32: 0, 0>, uniq_name = "_QFtest_simdEi"} : (i64) -> !llvm.ptr<i32>
%4 = llvm.mlir.constant(0 : i32) : i32
%5 = llvm.load %arg0 : !llvm.ptr<i32>
%6 = llvm.mlir.constant(1 : i32) : i32
diff --git a/mlir/test/Transforms/canonicalize-block-merge.mlir b/mlir/test/Transforms/canonicalize-block-merge.mlir
index d33c911e042d71..bf44973ab646c7 100644
--- a/mlir/test/Transforms/canonicalize-block-merge.mlir
+++ b/mlir/test/Transforms/canonicalize-block-merge.mlir
@@ -257,7 +257,7 @@ func.func @nomerge(%arg0: i32, %i: i32) {
func.func @mismatch_dominance() -> i32 {
// CHECK: %[[RES:.*]] = "test.producing_br"()
%0 = "test.producing_br"()[^bb1, ^bb2] {
- operand_segment_sizes = array<i32: 0, 0>
+ operandSegmentSizes = array<i32: 0, 0>
} : () -> i32
^bb1:
diff --git a/mlir/test/Transforms/sccp.mlir b/mlir/test/Transforms/sccp.mlir
index db24432b65cc6a..dcae052c29c248 100644
--- a/mlir/test/Transforms/sccp.mlir
+++ b/mlir/test/Transforms/sccp.mlir
@@ -204,7 +204,7 @@ func.func @simple_produced_operand() -> (i32, i32) {
// CHECK: %[[ONE:.*]] = arith.constant 1
%1 = arith.constant 1 : i32
"test.internal_br"(%1) [^bb1, ^bb2] {
- operand_segment_sizes = array<i32: 0, 1>
+ operandSegmentSizes = array<i32: 0, 1>
} : (i32) -> ()
^bb1:
diff --git a/mlir/test/lib/Dialect/Test/TestOpsSyntax.td b/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
index 6d9accd72493ac..9522a775e247da 100644
--- a/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
+++ b/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
@@ -715,7 +715,7 @@ def FormatInferTypeRegionsOp
}];
}
-// Test inferReturnTypes coupled with variadic operands (operand_segment_sizes).
+// Test inferReturnTypes coupled with variadic operands (operandSegmentSizes).
def FormatInferTypeVariadicOperandsOp
: TEST_Op<"format_infer_type_variadic_operands",
[InferTypeOpInterface, AttrSizedOperandSegments]> {
diff --git a/mlir/test/mlir-tblgen/op-decl-and-defs.td b/mlir/test/mlir-tblgen/op-decl-and-defs.td
index aad7ea4437e780..077aa750352e04 100644
--- a/mlir/test/mlir-tblgen/op-decl-and-defs.td
+++ b/mlir/test/mlir-tblgen/op-decl-and-defs.td
@@ -141,7 +141,7 @@ def NS_AttrSizedOperandOp : NS_Op<"attr_sized_operands",
Variadic<I32>:$b,
I32:$c,
Variadic<I32>:$d,
- I32ElementsAttr:$operand_segment_sizes
+ I32ElementsAttr:$operandSegmentSizes
);
}
diff --git a/mlir/test/mlir-tblgen/op-python-bindings.td b/mlir/test/mlir-tblgen/op-python-bindings.td
index de979f7e8f43e6..a131209fa45cb6 100644
--- a/mlir/test/mlir-tblgen/op-python-bindings.td
+++ b/mlir/test/mlir-tblgen/op-python-bindings.td
@@ -39,7 +39,7 @@ def AttrSizedOperandsOp : TestOp<"attr_sized_operands",
// CHECK: def variadic1(self):
// CHECK: operand_range = _ods_segmented_accessor(
// CHECK: self.operation.operands,
- // CHECK: self.operation.attributes["operand_segment_sizes"], 0)
+ // CHECK: self.operation.attributes["operandSegmentSizes"], 0)
// CHECK: return operand_range
// CHECK-NOT: if len(operand_range)
//
@@ -47,14 +47,14 @@ def AttrSizedOperandsOp : TestOp<"attr_sized_operands",
// CHECK: def non_variadic(self):
// CHECK: operand_range = _ods_segmented_accessor(
// CHECK: self.operation.operands,
- // CHECK: self.operation.attributes["operand_segment_sizes"], 1)
+ // CHECK: self.operation.attributes["operandSegmentSizes"], 1)
// CHECK: return operand_range[0]
//
// CHECK: @builtins.property
// CHECK: def variadic2(self):
// CHECK: operand_range = _ods_segmented_accessor(
// CHECK: self.operation.operands,
- // CHECK: self.operation.attributes["operand_segment_sizes"], 2)
+ // CHECK: self.operation.attributes["operandSegmentSizes"], 2)
// CHECK: return operand_range[0] if len(operand_range) > 0 else None
let arguments = (ins Variadic<AnyType>:$variadic1, AnyType:$non_variadic,
Optional<AnyType>:$variadic2);
@@ -83,21 +83,21 @@ def AttrSizedResultsOp : TestOp<"attr_sized_results",
// CHECK: def variadic1(self):
// CHECK: result_range = _ods_segmented_accessor(
// CHECK: self.operation.results,
- // CHECK: self.operation.attributes["result_segment_sizes"], 0)
+ // CHECK: self.operation.attributes["resultSegmentSizes"], 0)
// CHECK: return result_range[0] if len(result_range) > 0 else None
//
// CHECK: @builtins.property
// CHECK: def non_variadic(self):
// CHECK: result_range = _ods_segmented_accessor(
// CHECK: self.operation.results,
- // CHECK: self.operation.attributes["result_segment_sizes"], 1)
+ // CHECK: self.operation.attributes["resultSegmentSizes"], 1)
// CHECK: return result_range[0]
//
// CHECK: @builtins.property
// CHECK: def variadic2(self):
// CHECK: result_range = _ods_segmented_accessor(
// CHECK: self.operation.results,
- // CHECK: self.operation.attributes["result_segment_sizes"], 2)
+ // CHECK: self.operation.attributes["resultSegmentSizes"], 2)
// CHECK: return result_range
// CHECK-NOT: if len(result_range)
let results = (outs Optional<AnyType>:$variadic1, AnyType:$non_variadic,
diff --git a/mlir/test/python/dialects/linalg/ops.py b/mlir/test/python/dialects/linalg/ops.py
index 88f48d0d544e7c..b728e008378149 100644
--- a/mlir/test/python/dialects/linalg/ops.py
+++ b/mlir/test/python/dialects/linalg/ops.py
@@ -100,7 +100,7 @@ def named_form(lhs, rhs):
init_result = tensor.EmptyOp([4, 8], f32)
# CHECK: "linalg.matmul"(%{{.*}})
# CHECK-SAME: cast = #linalg.type_fn<cast_signed>
- # CHECK-SAME: odsOperandSegmentSizes = array<i32: 2, 1>
+ # CHECK-SAME: operandSegmentSizes = array<i32: 2, 1>
# CHECK-NEXT: ^bb0(%{{.*}}: f32, %{{.*}}: f32, %{{.*}}: f32):
# CHECK-NEXT: arith.mulf{{.*}} (f32, f32) -> f32
# CHECK-NEXT: arith.addf{{.*}} (f32, f32) -> f32
diff --git a/mlir/test/python/dialects/ods_helpers.py b/mlir/test/python/dialects/ods_helpers.py
index 71879bdcb51f5d..0d2a18e0eb0af2 100644
--- a/mlir/test/python/dialects/ods_helpers.py
+++ b/mlir/test/python/dialects/ods_helpers.py
@@ -96,8 +96,8 @@ class TestOp(OpView):
# CHECK: %[[V0:.+]] = "custom.value"
# CHECK: %[[V1:.+]] = "custom.value"
# CHECK: "custom.test_op"(%[[V0]], %[[V1]])
- # CHECK-NOT: operand_segment_sizes
- # CHECK-NOT: result_segment_sizes
+ # CHECK-NOT: operandSegmentSizes
+ # CHECK-NOT: resultSegmentSizes
# CHECK-SAME: : (i32, i32) -> (i8, i16)
print(m)
@@ -128,8 +128,8 @@ class TestOp(OpView):
# CHECK: %[[V2:.+]] = "custom.value"
# CHECK: %[[V3:.+]] = "custom.value"
# CHECK: "custom.test_op"(%[[V0]], %[[V1]], %[[V2]], %[[V3]])
- # CHECK-SAME: operand_segment_sizes = array<i32: 1, 2, 1>
- # CHECK-SAME: result_segment_sizes = array<i32: 2, 1, 1>
+ # CHECK-SAME: operandSegmentSizes = array<i32: 1, 2, 1>
+ # CHECK-SAME: resultSegmentSizes = array<i32: 2, 1, 1>
# CHECK-SAME: : (i32, i32, i32, i32) -> (i8, i16, i32, i64)
op = TestOp.build_generic(
results=[[t0, t1], t2, t3], operands=[v0, [v1, v2], v3]
@@ -137,8 +137,8 @@ class TestOp(OpView):
# Now test with optional omitted.
# CHECK: "custom.test_op"(%[[V0]])
- # CHECK-SAME: operand_segment_sizes = array<i32: 1, 0, 0>
- # CHECK-SAME: result_segment_sizes = array<i32: 0, 0, 1>
+ # CHECK-SAME: operandSegmentSizes = array<i32: 1, 0, 0>
+ # CHECK-SAME: resultSegmentSizes = array<i32: 0, 0, 1>
# CHECK-SAME: (i32) -> i64
op = TestOp.build_generic(
results=[None, None, t3], operands=[v0, None, None]
diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 36bf2460f3b5da..fec1fd859fe710 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -56,8 +56,8 @@ static const char *const propertyDiag = "propDiag";
/// The names of the implicit attributes that contain variadic operand and
/// result segment sizes.
-static const char *const operandSegmentAttrName = "operand_segment_sizes";
-static const char *const resultSegmentAttrName = "result_segment_sizes";
+static const char *const operandSegmentAttrName = "operandSegmentSizes";
+static const char *const resultSegmentAttrName = "resultSegmentSizes";
/// Code for an Op to lookup an attribute. Uses cached identifiers and subrange
/// lookup.
@@ -447,7 +447,7 @@ void OpOrAdaptorHelper::computeAttrMetadata() {
if (op.getDialect().usePropertiesForAttributes()) {
operandSegmentsSizeStorage =
llvm::formatv("std::array<int32_t, {0}>", op.getNumOperands());
- operandSegmentsSize = {"odsOperandSegmentSizes",
+ operandSegmentsSize = {"operandSegmentSizes",
makeProperty(operandSegmentsSizeStorage)};
} else {
attrMetadata.insert(
@@ -460,7 +460,7 @@ void OpOrAdaptorHelper::computeAttrMetadata() {
if (op.getDialect().usePropertiesForAttributes()) {
resultSegmentsSizeStorage =
llvm::formatv("std::array<int32_t, {0}>", op.getNumResults());
- resultSegmentsSize = {"odsResultSegmentSizes",
+ resultSegmentsSize = {"resultSegmentSizes",
makeProperty(resultSegmentsSizeStorage)};
} else {
attrMetadata.insert(
@@ -1296,10 +1296,12 @@ void OpEmitter::genPropertiesSupport() {
std::string getAttr;
llvm::raw_string_ostream os(getAttr);
os << " auto attr = dict.get(\"" << name << "\");";
- if (name == "odsOperandSegmentSizes") {
+ if (name == operandSegmentAttrName) {
+ // Backward compat for now, TODO: Remove at some point.
os << " if (!attr) attr = dict.get(\"operand_segment_sizes\");";
}
- if (name == "odsResultSegmentSizes") {
+ if (name == resultSegmentAttrName) {
+ // Backward compat for now, TODO: Remove at some point.
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
}
os.flush();
@@ -1318,10 +1320,12 @@ void OpEmitter::genPropertiesSupport() {
std::string getAttr;
llvm::raw_string_ostream os(getAttr);
os << " auto attr = dict.get(\"" << name << "\");";
- if (name == "odsOperandSegmentSizes") {
+ if (name == operandSegmentAttrName) {
+ // Backward compat for now
os << " if (!attr) attr = dict.get(\"operand_segment_sizes\");";
}
- if (name == "odsResultSegmentSizes") {
+ if (name == resultSegmentAttrName) {
+ // Backward compat for now
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
}
os.flush();
@@ -1458,34 +1462,34 @@ void OpEmitter::genPropertiesSupport() {
// even though it is a native property.
const auto *namedProperty = cast<const NamedProperty *>(attrOrProp);
StringRef name = namedProperty->name;
- if (name != "odsOperandSegmentSizes" && name != "odsResultSegmentSizes")
+ if (name != operandSegmentAttrName && name != resultSegmentAttrName)
continue;
auto &prop = namedProperty->prop;
FmtContext fctx;
fctx.addSubst("_ctxt", "ctx");
fctx.addSubst("_storage", Twine("prop.") + name);
- if (name == "odsOperandSegmentSizes") {
+ if (name == operandSegmentAttrName) {
getInherentAttrMethod
- << formatv(" if (name == \"odsOperandSegmentSizes\" || name == "
+ << formatv(" if (name == \"operand_segment_sizes\" || name == "
"\"{0}\") return ",
operandSegmentAttrName);
} else {
getInherentAttrMethod
- << formatv(" if (name == \"odsResultSegmentSizes\" || name == "
+ << formatv(" if (name == \"result_segment_sizes\" || name == "
"\"{0}\") return ",
resultSegmentAttrName);
}
getInherentAttrMethod << tgfmt(prop.getConvertToAttributeCall(), &fctx)
<< ";\n";
- if (name == "odsOperandSegmentSizes") {
- setInherentAttrMethod << formatv(
- " if (name == \"odsOperandSegmentSizes\" || name == "
- "\"{0}\") {{",
- operandSegmentAttrName);
+ if (name == operandSegmentAttrName) {
+ setInherentAttrMethod
+ << formatv(" if (name == \"operand_segment_sizes\" || name == "
+ "\"{0}\") {{",
+ operandSegmentAttrName);
} else {
setInherentAttrMethod
- << formatv(" if (name == \"odsResultSegmentSizes\" || name == "
+ << formatv(" if (name == \"result_segment_sizes\" || name == "
"\"{0}\") {{",
resultSegmentAttrName);
}
@@ -1499,7 +1503,7 @@ void OpEmitter::genPropertiesSupport() {
}
)decl",
name);
- if (name == "odsOperandSegmentSizes") {
+ if (name == operandSegmentAttrName) {
populateInherentAttrsMethod
<< formatv(" attrs.append(\"{0}\", {1});\n", operandSegmentAttrName,
tgfmt(prop.getConvertToAttributeCall(), &fctx));
@@ -2040,7 +2044,7 @@ void OpEmitter::genNamedOperandGetters() {
if (op.getTrait("::mlir::OpTrait::AttrSizedOperandSegments")) {
if (op.getDialect().usePropertiesForAttributes())
attrSizeInitCode = formatv(adapterSegmentSizeAttrInitCodeProperties,
- "getProperties().odsOperandSegmentSizes");
+ "getProperties().operandSegmentSizes");
else
attrSizeInitCode = formatv(opSegmentSizeAttrInitCode,
@@ -2082,7 +2086,7 @@ void OpEmitter::genNamedOperandSetters() {
body << formatv(", ::mlir::MutableOperandRange::OperandSegment({0}u, "
"{{getOperandSegmentSizesAttrName(), "
"DenseI32ArrayAttr::get(getContext(), "
- "getProperties().odsOperandSegmentSizes)})",
+ "getProperties().operandSegmentSizes)})",
i);
else
body << formatv(
@@ -2141,7 +2145,7 @@ void OpEmitter::genNamedResultGetters() {
if (attrSizedResults) {
if (op.getDialect().usePropertiesForAttributes())
attrSizeInitCode = formatv(adapterSegmentSizeAttrInitCodeProperties,
- "getProperties().odsResultSegmentSizes");
+ "getProperties().resultSegmentSizes");
else
attrSizeInitCode = formatv(opSegmentSizeAttrInitCode,
@@ -2316,7 +2320,7 @@ void OpEmitter::genSeparateArgParamBuilder() {
<< ");\n";
}
- // Automatically create the 'result_segment_sizes' attribute using
+ // Automatically create the 'resultSegmentSizes' attribute using
// the length of the type ranges.
if (op.getTrait("::mlir::OpTrait::AttrSizedResultSegments")) {
if (op.getDialect().usePropertiesForAttributes()) {
@@ -2346,7 +2350,7 @@ void OpEmitter::genSeparateArgParamBuilder() {
if (op.getDialect().usePropertiesForAttributes()) {
body << "}), " << builderOpState
<< ".getOrAddProperties<Properties>()."
- "odsResultSegmentSizes.begin());\n";
+ "resultSegmentSizes.begin());\n";
} else {
body << "}));\n";
}
@@ -2974,7 +2978,7 @@ void OpEmitter::genCodeForAddingArgAndRegionForBuilder(
emitSegment();
body << "}), " << builderOpState
<< ".getOrAddProperties<Properties>()."
- "odsOperandSegmentSizes.begin());\n";
+ "operandSegmentSizes.begin());\n";
} else {
body << " " << builderOpState << ".addAttribute(" << sizes << "AttrName("
<< builderOpState << ".name), "
@@ -3847,8 +3851,7 @@ OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
if (attr) {
storageType = attr->getStorageType();
} else {
- if (name != "odsOperandSegmentSizes" &&
- name != "odsResultSegmentSizes") {
+ if (name != operandSegmentAttrName && name != resultSegmentAttrName) {
report_fatal_error("unexpected AttributeMetadata");
}
// TODO: update to use native integers.
@@ -3963,7 +3966,7 @@ OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
if (op.getDialect().usePropertiesForAttributes())
sizeAttrInit =
formatv(adapterSegmentSizeAttrInitCodeProperties,
- llvm::formatv("getProperties().odsOperandSegmentSizes"));
+ llvm::formatv("getProperties().operandSegmentSizes"));
else
sizeAttrInit = formatv(adapterSegmentSizeAttrInitCode,
emitHelper.getAttr(operandSegmentAttrName));
diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index c38f873ddaba4c..5f33f7faf80c02 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1666,10 +1666,10 @@ void OperationFormat::genParserVariadicSegmentResolution(Operator &op,
llvm::interleaveComma(op.getOperands(), body, interleaveFn);
body << formatv("}), "
"result.getOrAddProperties<{0}::Properties>()."
- "odsOperandSegmentSizes.begin());\n",
+ "operandSegmentSizes.begin());\n",
op.getCppClassName());
} else {
- body << " result.addAttribute(\"operand_segment_sizes\", "
+ body << " result.addAttribute(\"operandSegmentSizes\", "
<< "parser.getBuilder().getDenseI32ArrayAttr({";
llvm::interleaveComma(op.getOperands(), body, interleaveFn);
body << "}));\n";
@@ -1710,10 +1710,10 @@ void OperationFormat::genParserVariadicSegmentResolution(Operator &op,
llvm::interleaveComma(op.getResults(), body, interleaveFn);
body << formatv("}), "
"result.getOrAddProperties<{0}::Properties>()."
- "odsResultSegmentSizes.begin());\n",
+ "resultSegmentSizes.begin());\n",
op.getCppClassName());
} else {
- body << " result.addAttribute(\"result_segment_sizes\", "
+ body << " result.addAttribute(\"resultSegmentSizes\", "
<< "parser.getBuilder().getDenseI32ArrayAttr({";
llvm::interleaveComma(op.getResults(), body, interleaveFn);
body << "}));\n";
@@ -1767,10 +1767,10 @@ static void genAttrDictPrinter(OperationFormat &fmt, Operator &op,
// Elide the variadic segment size attributes if necessary.
if (!fmt.allOperands &&
op.getTrait("::mlir::OpTrait::AttrSizedOperandSegments"))
- body << " elidedAttrs.push_back(\"operand_segment_sizes\");\n";
+ body << " elidedAttrs.push_back(\"operandSegmentSizes\");\n";
if (!fmt.allResultTypes &&
op.getTrait("::mlir::OpTrait::AttrSizedResultSegments"))
- body << " elidedAttrs.push_back(\"result_segment_sizes\");\n";
+ body << " elidedAttrs.push_back(\"resultSegmentSizes\");\n";
for (const StringRef key : fmt.inferredAttributes.keys())
body << " elidedAttrs.push_back(\"" << key << "\");\n";
for (const NamedAttribute *attr : fmt.usedAttributes)
diff --git a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
index dd6e52d300efe1..7c7b991fb7b07a 100644
--- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
@@ -170,7 +170,7 @@ constexpr const char *opVariadicSegmentTemplate = R"Py(
def {0}(self):
{1}_range = _ods_segmented_accessor(
self.operation.{1}s,
- self.operation.attributes["{1}_segment_sizes"], {2})
+ self.operation.attributes["{1}SegmentSizes"], {2})
return {1}_range{3}
)Py";
diff --git a/mlir/unittests/IR/AdaptorTest.cpp b/mlir/unittests/IR/AdaptorTest.cpp
index 4d1d49f56c8cd6..66ce53bbbadec9 100644
--- a/mlir/unittests/IR/AdaptorTest.cpp
+++ b/mlir/unittests/IR/AdaptorTest.cpp
@@ -40,7 +40,7 @@ TEST(Adaptor, GenericAdaptorsOperandAccess) {
// value from the value 0.
SmallVector<std::optional<int>> v = {0, 4};
OIListSimple::Properties prop;
- prop.odsOperandSegmentSizes = {1, 0, 1};
+ prop.operandSegmentSizes = {1, 0, 1};
OIListSimple::GenericAdaptor<ArrayRef<std::optional<int>>> d(v, {}, prop,
{});
EXPECT_EQ(d.getArg0(), 0);
More information about the flang-commits
mailing list