[Mlir-commits] [mlir] [mlir][ArmSME] Rename slice move operations to insert/extract_tile_slice (PR #106755)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Aug 30 09:16:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-sme
@llvm/pr-subscribers-mlir
Author: Benjamin Maxwell (MacDue)
<details>
<summary>Changes</summary>
This renames:
- `arm_sme.move_tile_slice_to_vector` to `arm_sme.extract_tile_slice`
- `arm_sme.move_vector_to_tile_slice` to `arm_sme.insert_tile_slice`
The new names are more consistent with the rest of MLIR and should be easier to understand. The current names (to me personally) are hard to parse, and easy to mix up when skimming through code.
Additionally, the syntax for `insert_tile_slice` has changed from:
```mlir
%4 = arm_sme.insert_tile_slice %0, %1, %2
: vector<[16]xi8> into vector<[16]x[16]xi8>
```
To:
```mlir
%4 = arm_sme.insert_tile_slice %0, %1[%2]
: vector<[16]xi8> into vector<[16]x[16]xi8>
```
This is for consistency with `extract_tile_slice`, but also helps with readability as it makes it clear which operand is the index.
---
Patch is 94.37 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/106755.diff
13 Files Affected:
- (modified) mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td (+19-19)
- (modified) mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp (+3-3)
- (modified) mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp (+29-31)
- (modified) mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp (+4-4)
- (modified) mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp (+30-31)
- (modified) mlir/test/Conversion/ArithToArmSME/arith-to-arm-sme.mlir (+2-2)
- (modified) mlir/test/Conversion/ArmSMEToLLVM/arm-sme-to-llvm.mlir (+38-38)
- (modified) mlir/test/Conversion/ArmSMEToSCF/arm-sme-to-scf.mlir (+1-1)
- (modified) mlir/test/Conversion/VectorToArmSME/vector-to-arm-sme.mlir (+53-53)
- (modified) mlir/test/Dialect/ArmSME/invalid.mlir (+8-8)
- (modified) mlir/test/Dialect/ArmSME/roundtrip.mlir (+62-62)
- (modified) mlir/test/Dialect/ArmSME/tile-allocation-copies.mlir (+2-2)
- (modified) mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir (+28-28)
``````````diff
diff --git a/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td b/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
index 3f1776f57e4c71..07c082cceac09e 100644
--- a/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
+++ b/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
@@ -592,7 +592,7 @@ def StoreTileSliceOp : ArmSME_Op<"store_tile_slice", [
}];
}
-def MoveVectorToTileSliceOp : ArmSME_Op<"move_vector_to_tile_slice", [
+def InsertTileSliceOp : ArmSME_Op<"insert_tile_slice", [
ArmSMETileOpInterface, Pure,
AllTypesMatch<["tile", "result"]>,
TypesMatchWith<
@@ -603,25 +603,25 @@ def MoveVectorToTileSliceOp : ArmSME_Op<"move_vector_to_tile_slice", [
"::llvm::cast<mlir::VectorType>($_self).getElementType(),"
"/*scalableDims=*/{true})">,
]> {
- let summary = "Move 1-D scalable vector to slice of 2-D tile";
+ let summary = "Insert 1-D scalable vector into slice of 2-D tile";
let description = [{
- The vector to tile slice operation moves a 1-D scalable vector to a slice
- of a 2-D scalable vector tile at the given index. The type of the 1-D
- scalable vector to be moved must match the type of the tile slice. A tile
- slice is a 1-D vector of horizontally or vertically contiguous elements
- within a ZA tile. The updated tile is returned as the result.
+ Inserts a 1-D scalable vector to a slice of a 2-D scalable vector tile at
+ the given index. The type of the 1-D scalable vector to be moved must match
+ the type of the tile slice. A tile slice is a 1-D vector of horizontally or
+ vertically contiguous elements within a ZA tile. The updated tile is
+ returned as the result.
An optional tile slice layout attribute specifies whether the tile slice is
horizontal (default) or vertical.
- Example 1: Move a vector<[16]xi8> into tile horizontally (default) at given index.
+ Example 1: Insert `vector<[16]xi8>` into tile horizontally at the given index.
```mlir
- %tile_update = arm_sme.move_vector_to_tile_slice %vector, %tile, %tile_slice_index : vector<[16]xi8> into vector<[16]x[16]xi8>
+ %tile_update = arm_sme.insert_tile_slice %vector, %tile[%tile_slice_index] : vector<[16]xi8> into vector<[16]x[16]xi8>
```
- Example 2: Move a vector<[2]xf64> into tile vertically at given index.
+ Example 2: Insert `vector<[2]xf64>` into tile vertically at the given index.
```mlir
- %tile_update = arm_sme.move_vector_to_tile_slice %vector, %tile, %tile_slice_index layout<vertical> : vector<[2]xf64> into vector<[2]x[2]xf64>
+ %tile_update = arm_sme.insert_tile_slice %vector, %tile[%tile_slice_index] layout<vertical> : vector<[2]xf64> into vector<[2]x[2]xf64>
```
}];
let arguments = (ins
@@ -636,35 +636,35 @@ def MoveVectorToTileSliceOp : ArmSME_Op<"move_vector_to_tile_slice", [
}];
let assemblyFormat = [{
- $vector `,` $tile `,` $tile_slice_index (`layout` `` $layout^)?
+ $vector `,` $tile `[` $tile_slice_index `]` (`layout` `` $layout^)?
attr-dict `:` type($vector) `into` type($result)
}];
}
-def MoveTileSliceToVectorOp : ArmSME_Op<"move_tile_slice_to_vector", [
+def ExtractTileSliceOp : ArmSME_Op<"extract_tile_slice", [
ArmSMETileOpInterface, Pure,
TypesMatchWith<
"type of 'result' matches type of 'tile' slice",
"tile", "result",
"VectorType(VectorType::Builder(::llvm::cast<mlir::VectorType>($_self)).dropDim(0))">,
]> {
- let summary = "Move slice of a 2-D tile to a 1-D scalable vector";
+ let summary = "Extract 1-D scalable vector from slice of 2-D tile";
let description = [{
- The tile slice to vector operation extracts a 1-D scalable slice from a 2-D
- scalable tile at the given index. A tile slice is a 1-D vector of
- horizontally or vertically contiguous elements within a ZA tile.
+ Extracts a 1-D scalable slice from a 2-D scalable tile at the given index.
+ A tile slice is a 1-D vector of horizontally or vertically contiguous
+ elements within a ZA tile.
An optional tile slice layout attribute specifies whether the tile slice is
horizontal (default) or vertical.
Example 1: Extract `vector<[16]xi8>` from tile horizontally at the given index.
```mlir
- %slice = arm_sme.move_tile_slice_to_vector %tile[%tile_slice_index] : vector<[16]xi8> from vector<[16]x[16]xi8>
+ %slice = arm_sme.extract_tile_slice %tile[%tile_slice_index] : vector<[16]xi8> from vector<[16]x[16]xi8>
```
Example 2: Extract `vector<[2]xf64>` from tile vertically at the given index.
```mlir
- %slice = arm_sme.move_tile_slice_to_vector %tile[%tile_slice_index] layout<vertical> : vector<[2]xf64> from vector<[2]x[2]xf64>
+ %slice = arm_sme.extract_tile_slice %tile[%tile_slice_index] layout<vertical> : vector<[2]xf64> from vector<[2]x[2]xf64>
```
}];
diff --git a/mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp b/mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp
index b12aa92001ff29..5aa2a098b17621 100644
--- a/mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp
+++ b/mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp
@@ -64,7 +64,7 @@ struct ConstantOpToArmSMELowering : public OpRewritePattern<arith::ConstantOp> {
return success();
}
- // Lower non-zero constants to a loop of 'arm_sme.move_vector_to_tile_slice'
+ // Lower non-zero constants to a loop of 'arm_sme.insert_tile_slice'
// ops that broadcast the constant to each tile slice.
auto loc = constantOp.getLoc();
@@ -79,9 +79,9 @@ struct ConstantOpToArmSMELowering : public OpRewritePattern<arith::ConstantOp> {
auto initTile = rewriter.create<arm_sme::GetTileOp>(loc, tileType);
auto makeLoopBody = [&](OpBuilder &b, Location loc, Value tileSliceIndex,
Value currentTile) {
- // Create 'arm_sme.move_vector_to_tile_slice' to write vector to tile
+ // Create 'arm_sme.insert_tile_slice' to write vector to tile
// slice.
- auto nextTile = b.create<arm_sme::MoveVectorToTileSliceOp>(
+ auto nextTile = b.create<arm_sme::InsertTileSliceOp>(
loc, tileType, constantOp1D, currentTile, tileSliceIndex);
return nextTile.getResult();
};
diff --git a/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp b/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp
index 1ad2ec6cee7f8c..f1fa411b82914a 100644
--- a/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp
+++ b/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp
@@ -575,23 +575,23 @@ struct StoreTileSliceConversion
}
};
-/// Lower `arm_sme.move_vector_to_tile_slice` to SME intrinsics.
-struct MoveVectorToTileSliceConversion
- : public ConvertArmSMEOpToLLVMPattern<arm_sme::MoveVectorToTileSliceOp> {
+/// Lower `arm_sme.insert_tile_slice` to SME intrinsics.
+struct InsertTileSliceConversion
+ : public ConvertArmSMEOpToLLVMPattern<arm_sme::InsertTileSliceOp> {
using ConvertArmSMEOpToLLVMPattern::ConvertArmSMEOpToLLVMPattern;
LogicalResult
- matchAndRewrite(arm_sme::MoveVectorToTileSliceOp moveVectorToTileSliceOp,
- arm_sme::MoveVectorToTileSliceOp::Adaptor adaptor,
+ matchAndRewrite(arm_sme::InsertTileSliceOp insertTileSliceOp,
+ arm_sme::InsertTileSliceOp::Adaptor adaptor,
ConversionPatternRewriter &rewriter) const override {
- auto loc = moveVectorToTileSliceOp.getLoc();
- auto tileType = moveVectorToTileSliceOp.getTileType();
+ auto loc = insertTileSliceOp.getLoc();
+ auto tileType = insertTileSliceOp.getTileType();
- auto tileId = getTileIdOrError(moveVectorToTileSliceOp);
+ auto tileId = getTileIdOrError(insertTileSliceOp);
if (!tileId)
return failure();
- auto tileSlice = moveVectorToTileSliceOp.getTileSliceIndex();
+ auto tileSlice = insertTileSliceOp.getTileSliceIndex();
// Cast tile slice from index to i32 for intrinsic.
auto tileSliceI32 = rewriter.create<arith::IndexCastUIOp>(
@@ -606,42 +606,40 @@ struct MoveVectorToTileSliceConversion
auto allActiveMask = rewriter.create<vector::SplatOp>(loc, predTy, one);
// Create 'arm_sme.intr.write.(horiz|vert)' to write vector to tile slice.
- switch (moveVectorToTileSliceOp.getLayout()) {
+ switch (insertTileSliceOp.getLayout()) {
case arm_sme::TileSliceLayout::Horizontal:
rewriter.create<arm_sme::aarch64_sme_write_horiz>(
loc, tileId, tileSliceI32, allActiveMask,
- moveVectorToTileSliceOp.getVector());
+ insertTileSliceOp.getVector());
break;
case arm_sme::TileSliceLayout::Vertical:
rewriter.create<arm_sme::aarch64_sme_write_vert>(
loc, tileId, tileSliceI32, allActiveMask,
- moveVectorToTileSliceOp.getVector());
+ insertTileSliceOp.getVector());
break;
}
- // Intrinsic has no result, replace 'arm_sme.move_vector_to_tile_slice' with
+ // Intrinsic has no result, replace 'arm_sme.insert_tile_slice' with
// the input tile to preserve dataflow.
- rewriter.replaceOp(moveVectorToTileSliceOp,
- moveVectorToTileSliceOp.getTile());
+ rewriter.replaceOp(insertTileSliceOp, insertTileSliceOp.getTile());
return success();
}
};
-/// Lower `arm_sme.move_tile_slice_to_vector` to SME intrinsics.
-struct MoveTileSliceToVectorConversion
- : public ConvertArmSMEOpToLLVMPattern<arm_sme::MoveTileSliceToVectorOp> {
+/// Lower `arm_sme.extract_tile_slice` to SME intrinsics.
+struct ExtractTileSliceConversion
+ : public ConvertArmSMEOpToLLVMPattern<arm_sme::ExtractTileSliceOp> {
using ConvertArmSMEOpToLLVMPattern::ConvertArmSMEOpToLLVMPattern;
LogicalResult
- matchAndRewrite(arm_sme::MoveTileSliceToVectorOp moveTileSliceToVector,
- OpAdaptor,
+ matchAndRewrite(arm_sme::ExtractTileSliceOp extractTileSlice, OpAdaptor,
ConversionPatternRewriter &rewriter) const override {
- auto loc = moveTileSliceToVector.getLoc();
- auto sliceType = moveTileSliceToVector.getSliceType();
- auto sliceIndex = moveTileSliceToVector.getTileSliceIndex();
+ auto loc = extractTileSlice.getLoc();
+ auto sliceType = extractTileSlice.getSliceType();
+ auto sliceIndex = extractTileSlice.getTileSliceIndex();
- auto tileId = getTileIdOrError(moveTileSliceToVector);
+ auto tileId = getTileIdOrError(extractTileSlice);
if (!tileId)
return failure();
@@ -659,16 +657,16 @@ struct MoveTileSliceToVectorConversion
loc, rewriter.getI32Type(), sliceIndex);
// Create 'arm_sme.intr.read.(horiz|vert)' to extract the tile slice.
- switch (moveTileSliceToVector.getLayout()) {
+ switch (extractTileSlice.getLayout()) {
case arm_sme::TileSliceLayout::Horizontal:
rewriter.replaceOpWithNewOp<arm_sme::aarch64_sme_read_horiz>(
- moveTileSliceToVector, sliceType, zeroVector, allTruePredicate,
- tileId, sliceIndexI32);
+ extractTileSlice, sliceType, zeroVector, allTruePredicate, tileId,
+ sliceIndexI32);
break;
case arm_sme::TileSliceLayout::Vertical:
rewriter.replaceOpWithNewOp<arm_sme::aarch64_sme_read_vert>(
- moveTileSliceToVector, sliceType, zeroVector, allTruePredicate,
- tileId, sliceIndexI32);
+ extractTileSlice, sliceType, zeroVector, allTruePredicate, tileId,
+ sliceIndexI32);
break;
}
@@ -985,8 +983,8 @@ void mlir::populateArmSMEToLLVMConversionPatterns(LLVMTypeConverter &converter,
});
addArmSMEConversionPatterns<
- LoadTileSliceConversion, MoveTileSliceToVectorConversion,
- MoveVectorToTileSliceConversion, StoreTileSliceConversion,
+ LoadTileSliceConversion, ExtractTileSliceConversion,
+ InsertTileSliceConversion, StoreTileSliceConversion,
StreamingVLOpConversion, OuterProductOpConversion,
OuterProductWideningOpConversion<arm_sme::FMopa2WayOp,
arm_sme::aarch64_sme_mopa_wide>,
diff --git a/mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp b/mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp
index 9f55932c33af66..195ee28581bcf0 100644
--- a/mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp
+++ b/mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp
@@ -245,7 +245,7 @@ struct TileLoadOpConversion : public OpRewritePattern<arm_sme::TileLoadOp> {
/// : memref<?x?xi32>, vector<[4]xi1>,
/// vector<[4]xi32> into vector<[4]xi32>
/// // Insert slice into tile
-/// %tile_update = arm_sme.move_vector_to_tile_slice
+/// %tile_update = arm_sme.insert_tile_slice
/// %slice, %iter_tile, %tile_slice_idx :
/// vector<[4]xi32> into vector<[4]x[4]xi32>
/// scf.yield %tile_update : vector<[4]x[4]xi32>
@@ -332,11 +332,11 @@ struct TileLoadOpWithMaskAndPadNonZeroConversion
loc, tileSliceType, tileLoadOp.getBase(), memrefIndices, maskOp1D,
/*passthru=*/pad1DOp);
- // Create 'arm_sme.move_vector_to_tile_slice' to move slice into tile.
- auto moveSlice = rewriter.create<arm_sme::MoveVectorToTileSliceOp>(
+ // Create 'arm_sme.insert_tile_slice' to insert slice into tile.
+ auto insertSlice = rewriter.create<arm_sme::InsertTileSliceOp>(
loc, tileType, loadSlice->getResult(0), currentTile, tileSliceIndex,
tileLoadOp.getLayout());
- rewriter.create<scf::YieldOp>(loc, moveSlice.getResult());
+ rewriter.create<scf::YieldOp>(loc, insertSlice.getResult());
rewriter.setInsertionPointAfter(forOp);
diff --git a/mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp b/mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp
index ee52b9ef6a6f6b..d87d5c50aec757 100644
--- a/mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp
+++ b/mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp
@@ -199,7 +199,7 @@ struct VectorStoreToArmSMELowering : public OpRewritePattern<vector::StoreOp> {
/// %broadcast_to_tile = scf.for %tile_slice_index = %c0 to %num_tile_slices
/// step %c1 iter_args(%iter_tile = %init_tile) -> (vector<[4]x[4]xi32>)
/// {
-/// %tile_update = arm_sme.move_vector_to_tile_slice
+/// %tile_update = arm_sme.insert_tile_slice
/// %broadcast_to_1d, %iter_tile, %tile_slice_index :
/// vector<[4]xi32> into vector<[4]x[4]xi32>
/// scf.yield %tile_update : vector<[4]x[4]xi32>
@@ -238,9 +238,9 @@ struct BroadcastOpToArmSMELowering
auto makeLoopBody = [&](OpBuilder &b, Location loc, Value tileSliceIndex,
Value currentTile) {
- // Create 'arm_sme.move_vector_to_tile_slice' to broadcast the value
+ // Create 'arm_sme.insert_tile_slice' to broadcast the value
// to each tile slice.
- auto nextTile = b.create<arm_sme::MoveVectorToTileSliceOp>(
+ auto nextTile = b.create<arm_sme::InsertTileSliceOp>(
loc, tileType, broadcastOp1D, currentTile, tileSliceIndex);
return nextTile.getResult();
};
@@ -267,7 +267,7 @@ struct BroadcastOpToArmSMELowering
/// %broadcast_to_tile = scf.for %tile_slice_index = %c0 to %num_tile_slices
/// step %c1 iter_args(%iter_tile = %init_tile) -> (vector<[4]x[4]xi32>)
/// {
-/// %tile_update = arm_sme.move_vector_to_tile_slice
+/// %tile_update = arm_sme.insert_tile_slice
/// %broadcast_to_1d, %iter_tile, %tile_slice_index :
/// vector<[4]xi32> into vector<[4]x[4]xi32>
/// scf.yield %tile_update : vector<[4]x[4]xi32>
@@ -299,7 +299,7 @@ struct SplatOpToArmSMELowering : public OpRewritePattern<vector::SplatOp> {
auto makeLoopBody = [&](OpBuilder &b, Location loc, Value tileSliceIndex,
Value currentTile) {
- auto nextTile = b.create<arm_sme::MoveVectorToTileSliceOp>(
+ auto nextTile = b.create<arm_sme::InsertTileSliceOp>(
loc, tileType, broadcastOp1D, currentTile, tileSliceIndex);
return nextTile.getResult();
};
@@ -497,7 +497,7 @@ struct VectorOuterProductToArmSMELowering
}
};
-/// Lower `vector.extract` using `arm_sme.move_tile_slice_to_vector`.
+/// Lower `vector.extract` using `arm_sme.extract_tile_slice`.
///
/// Example:
/// ```
@@ -505,7 +505,7 @@ struct VectorOuterProductToArmSMELowering
/// ```
/// Becomes:
/// ```
-/// %slice = arm_sme.move_tile_slice_to_vector %tile[%row]
+/// %slice = arm_sme.extract_tile_slice %tile[%row]
/// : vector<[4]xi32> from vector<[4]x[4]xi32>
/// %el = vector.extract %slice[%col] : i32 from vector<[4]xi32>
/// ```
@@ -531,27 +531,26 @@ struct VectorExtractToArmSMELowering
}
Value sliceIndex = vector::getAsValues(rewriter, loc, position[0]).front();
- auto moveTileSliceToVector =
- rewriter.create<arm_sme::MoveTileSliceToVectorOp>(loc, sourceVector,
- sliceIndex);
+ auto extractTileSlice = rewriter.create<arm_sme::ExtractTileSliceOp>(
+ loc, sourceVector, sliceIndex);
if (position.size() == 1) {
// Single index case: Extracts a 1D slice.
- rewriter.replaceOp(extractOp, moveTileSliceToVector);
+ rewriter.replaceOp(extractOp, extractTileSlice);
return success();
}
// Two indices case: Extracts a single element.
assert(position.size() == 2);
- rewriter.replaceOpWithNewOp<vector::ExtractOp>(
- extractOp, moveTileSliceToVector, position[1]);
+ rewriter.replaceOpWithNewOp<vector::ExtractOp>(extractOp, extractTileSlice,
+ position[1]);
return success();
}
};
-/// Lower `vector.insert` using `arm_sme.move_vector_to_tile_slice` and
-/// `arm_sme.move_tile_slice_to_vector`.
+/// Lower `vector.insert` using `arm_sme.insert_tile_slice` and
+/// `arm_sme.extract_tile_slice`.
///
/// Example:
/// ```
@@ -560,10 +559,10 @@ struct VectorExtractToArmSMELowering
/// ```
/// Becomes:
/// ```
-/// %slice = arm_sme.move_tile_slice_to_vector %tile[%row]
+/// %slice = arm_sme.extract_tile_slice %tile[%row]
/// : vector<[4]xi32> from vector<[4]x[4]xi32>
/// %new_slice = vector.insert %el, %slice[%col] : i32 into vector<[4]xi32>
-/// %new_tile = arm_sme.move_vector_to_tile_slice %new_slice, %tile, %row
+/// %new_tile = arm_sme.insert_tile_slice %new_slice, %tile[%row]
/// : vector<[4]xi32> into vector<[4]x[4]xi32>
/// ```
struct VectorInsertToArmSMELowering
@@ -594,21 +593,21 @@ struct VectorInsertToArmSMELowering
if (position.size() == 2) {
// Two indices case: Insert single element into tile.
// We need to first extract the existing slice and update the element.
- tileSlice = rewriter.create<arm_sme::MoveTileSliceToVectorOp>(
+ tileSlice = rewriter.create<arm_sme::ExtractTileSliceOp>(
loc, insertOp.getDest(), sliceIndex);
tileSlice = rewriter.create<vector::InsertOp>(loc, source, tileSlice,
position[1]);
}
// Insert the slice into the destination tile.
- rewriter.replaceOpWithNewOp<arm_sme::MoveVectorToTileSliceOp>(
+ rewriter.replaceOpWithNewOp<arm_sme::InsertTileSliceOp>(
insertOp, tileSlice, insertOp.getDest(), sliceIndex);
return success();
}
};
/// Lowers `vector.print` of a tile into a loop over the rows of the tile,
-/// extracting them via `arm_sme.move_tile_slice_to_vector`, then printing with
+/// extracting them via `arm_sme.extract_tile_slice`, then printing with
/// a 1D `vector.print`.
///
/// BEFORE:
@@ -623,7 +622,7 @@ struct VectorInsertToArmSMELowering
/// %vscale = vector.vscale
/// %svl_s = arith.muli %c4, %vscale : index
/// scf.for %i = %c0 to %svl_s step %c1 {
-/// %tile_slice = arm_sme.move_tile_slice_to_vector %tile[%i]
+/// %tile_slice = arm_sme.extract_tile_slice %tile[%i]
/// : vector<[4]xf32> from vector<[4]x[4]xf32>
/// vector.print %tile_slice : vector<[4]xf32>
/// }
@@ -655,7 +654,7 @@ struct VectorPrintToArmSMELowering : public OpRewritePattern<vector::PrintOp> {
rewriter.setInsertionPointToStart(forOp.getBody());
// Extract the current row from the tile.
Value rowIndex = forOp.getInductionVar();
- auto tileSlice = rewriter.create<arm_sme::MoveTileSliceToVectorOp>(
+ auto tileSlice = rewriter.create<arm_sme::ExtractTileSliceOp>(
loc, printOp.getSource(), rowIndex);
// Print the row with a 1D vector.print.
rewriter.create<vector::PrintOp...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/106755
More information about the Mlir-commits
mailing list