@@ -2047,8 +2047,8 @@ def Vector_GatherOp :
20472047 DeclareOpInterfaceMethods<VectorUnrollOpInterface, ["getShapeForUnroll"]>
20482048 ]>,
20492049 Arguments<(ins Arg<TensorOrMemRef<[AnyType]>, "", [MemRead]>:$base,
2050- Variadic<Index>:$indices ,
2051- VectorOfNonZeroRankOf<[AnyInteger, Index]>:$index_vec ,
2050+ Variadic<Index>:$offsets ,
2051+ VectorOfNonZeroRankOf<[AnyInteger, Index]>:$indices ,
20522052 VectorOfNonZeroRankOf<[I1]>:$mask,
20532053 AnyVectorOfNonZeroRank:$pass_thru,
20542054 ConfinedAttr<OptionalAttr<I64Attr>,
@@ -2072,19 +2072,19 @@ def Vector_GatherOp :
20722072
20732073 ```mlir
20742074 func.func @gather_3D_to_2D(
2075- %base: memref<?x10x?xf32>, %i0 : index, %i1 : index, %i2 : index,
2076- %index_vec : vector<2x3xi32>, %mask: vector<2x3xi1>,
2075+ %base: memref<?x10x?xf32>, %ofs_0 : index, %ofs_1 : index, %ofs_2 : index,
2076+ %indices : vector<2x3xi32>, %mask: vector<2x3xi1>,
20772077 %fall_thru: vector<2x3xf32>) -> vector<2x3xf32> {
2078- %result = vector.gather %base[%i0 , %i1 , %i2 ]
2079- [%index_vec ], %mask, %fall_thru : [...]
2078+ %result = vector.gather %base[%ofs_0 , %ofs_1 , %ofs_2 ]
2079+ [%indices ], %mask, %fall_thru : [...]
20802080 return %result : vector<2x3xf32>
20812081 }
20822082 ```
20832083
20842084 The indexing semantics are then,
20852085
20862086 ```
2087- result[i,j] := if mask[i,j] then base[i0, i1, i2 + index_vec [i,j]]
2087+ result[i,j] := if mask[i,j] then base[i0, i1, i2 + indices [i,j]]
20882088 else pass_thru[i,j]
20892089 ```
20902090 The index into `base` only varies in the innermost ((k-1)-th) dimension.
@@ -2118,16 +2118,16 @@ def Vector_GatherOp :
21182118
21192119 let extraClassDeclaration = [{
21202120 ShapedType getBaseType() { return getBase().getType(); }
2121- VectorType getIndexVectorType() { return getIndexVec ().getType(); }
2121+ VectorType getIndexVectorType() { return getIndices ().getType(); }
21222122 VectorType getMaskVectorType() { return getMask().getType(); }
21232123 VectorType getPassThruVectorType() { return getPassThru().getType(); }
21242124 VectorType getVectorType() { return getResult().getType(); }
21252125 }];
21262126
21272127 let assemblyFormat =
2128- "$base `[` $indices `]` `[` $index_vec `]` `,` "
2128+ "$base `[` $offsets `]` `[` $indices `]` `,` "
21292129 "$mask `,` $pass_thru attr-dict `:` type($base) `,` "
2130- "type($index_vec ) `,` type($mask) `,` type($pass_thru) "
2130+ "type($indices ) `,` type($mask) `,` type($pass_thru) "
21312131 "`into` type($result)";
21322132 let hasCanonicalizer = 1;
21332133 let hasVerifier = 1;
@@ -2150,8 +2150,8 @@ def Vector_GatherOp :
21502150def Vector_ScatterOp :
21512151 Vector_Op<"scatter">,
21522152 Arguments<(ins Arg<AnyMemRef, "", [MemWrite]>:$base,
2153- Variadic<Index>:$indices ,
2154- VectorOfNonZeroRankOf<[AnyInteger, Index]>:$index_vec ,
2153+ Variadic<Index>:$offsets ,
2154+ VectorOfNonZeroRankOf<[AnyInteger, Index]>:$indices ,
21552155 VectorOfNonZeroRankOf<[I1]>:$mask,
21562156 AnyVectorOfNonZeroRank:$valueToStore,
21572157 ConfinedAttr<OptionalAttr<I64Attr>,
@@ -2207,15 +2207,15 @@ def Vector_ScatterOp :
22072207
22082208 let extraClassDeclaration = [{
22092209 MemRefType getMemRefType() { return getBase().getType(); }
2210- VectorType getIndexVectorType() { return getIndexVec ().getType(); }
2210+ VectorType getIndexVectorType() { return getIndices ().getType(); }
22112211 VectorType getMaskVectorType() { return getMask().getType(); }
22122212 VectorType getVectorType() { return getValueToStore().getType(); }
22132213 }];
22142214
22152215 let assemblyFormat =
2216- "$base `[` $indices `]` `[` $index_vec `]` `,` "
2216+ "$base `[` $offsets `]` `[` $indices `]` `,` "
22172217 "$mask `,` $valueToStore attr-dict `:` type($base) `,` "
2218- "type($index_vec ) `,` type($mask) `,` type($valueToStore)";
2218+ "type($indices ) `,` type($mask) `,` type($valueToStore)";
22192219 let hasCanonicalizer = 1;
22202220 let hasVerifier = 1;
22212221
0 commit comments