Skip to content

Commit 37ebb1d

Browse files
committed
[mlir][vector] Use result consistently as the result argument name
This patch updates the following ops to use `result` (instead of `res`) as the name for their result argument: * `vector.scalable.insert` * `vector.scalable.extract` * `vector.insert_strided_slice` This change ensures naming consistency with other ops in the `vector` dialect. It addresses part of: * #131602
1 parent 577199f commit 37ebb1d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mlir/include/mlir/Dialect/Vector/IR/VectorOps.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -959,15 +959,15 @@ def Vector_InsertOp :
959959
def Vector_ScalableInsertOp :
960960
Vector_Op<"scalable.insert", [Pure,
961961
AllElementTypesMatch<["valueToStore", "dest"]>,
962-
AllTypesMatch<["dest", "res"]>,
962+
AllTypesMatch<["dest", "result"]>,
963963
PredOpTrait<"position is a multiple of the source length.",
964964
CPred<
965965
"(getPos() % getSourceVectorType().getNumElements()) == 0"
966966
>>]>,
967967
Arguments<(ins VectorOfRank<[1]>:$valueToStore,
968968
ScalableVectorOfRank<[1]>:$dest,
969969
I64Attr:$pos)>,
970-
Results<(outs ScalableVectorOfRank<[1]>:$res)> {
970+
Results<(outs ScalableVectorOfRank<[1]>:$result)> {
971971
let summary = "insert subvector into scalable vector operation";
972972
// NOTE: This operation is designed to map to `llvm.vector.insert`, and its
973973
// documentation should be kept aligned with LLVM IR:
@@ -1015,14 +1015,14 @@ def Vector_ScalableInsertOp :
10151015

10161016
def Vector_ScalableExtractOp :
10171017
Vector_Op<"scalable.extract", [Pure,
1018-
AllElementTypesMatch<["source", "res"]>,
1018+
AllElementTypesMatch<["source", "result"]>,
10191019
PredOpTrait<"position is a multiple of the result length.",
10201020
CPred<
10211021
"(getPos() % getResultVectorType().getNumElements()) == 0"
10221022
>>]>,
10231023
Arguments<(ins ScalableVectorOfRank<[1]>:$source,
10241024
I64Attr:$pos)>,
1025-
Results<(outs VectorOfRank<[1]>:$res)> {
1025+
Results<(outs VectorOfRank<[1]>:$result)> {
10261026
let summary = "extract subvector from scalable vector operation";
10271027
// NOTE: This operation is designed to map to `llvm.vector.extract`, and its
10281028
// documentation should be kept aligned with LLVM IR:
@@ -1051,15 +1051,15 @@ def Vector_ScalableExtractOp :
10511051
}];
10521052

10531053
let assemblyFormat = [{
1054-
$source `[` $pos `]` attr-dict `:` type($res) `from` type($source)
1054+
$source `[` $pos `]` attr-dict `:` type($result) `from` type($source)
10551055
}];
10561056

10571057
let extraClassDeclaration = extraPoisonClassDeclaration # [{
10581058
VectorType getSourceVectorType() {
10591059
return ::llvm::cast<VectorType>(getSource().getType());
10601060
}
10611061
VectorType getResultVectorType() {
1062-
return ::llvm::cast<VectorType>(getRes().getType());
1062+
return ::llvm::cast<VectorType>(getResult().getType());
10631063
}
10641064
}];
10651065
}
@@ -1068,10 +1068,10 @@ def Vector_InsertStridedSliceOp :
10681068
Vector_Op<"insert_strided_slice", [Pure,
10691069
PredOpTrait<"operand #0 and result have same element type",
10701070
TCresVTEtIsSameAsOpBase<0, 0>>,
1071-
AllTypesMatch<["dest", "res"]>]>,
1071+
AllTypesMatch<["dest", "result"]>]>,
10721072
Arguments<(ins AnyVectorOfNonZeroRank:$valueToStore, AnyVectorOfNonZeroRank:$dest, I64ArrayAttr:$offsets,
10731073
I64ArrayAttr:$strides)>,
1074-
Results<(outs AnyVectorOfNonZeroRank:$res)> {
1074+
Results<(outs AnyVectorOfNonZeroRank:$result)> {
10751075
let summary = "strided_slice operation";
10761076
let description = [{
10771077
Takes a k-D valueToStore vector, an n-D destination vector (n >= k), n-sized

0 commit comments

Comments
 (0)