Skip to content

Commit 180145d

Browse files
committed
[mlir][vector] Move tests for rewriteAlignedSubByteInt{Ext|Trunc} (nfc)
Moves tests for `rewriteAlignedSubByteIntExt` and `rewriteAlignedSubByteIntTrunc` into a dedicated files. Also adds + fixes some comments. This is merely for better organisation and so that it's easier to identify the patterns and edge cases being tested.
1 parent 02fb976 commit 180145d

File tree

3 files changed

+420
-382
lines changed

3 files changed

+420
-382
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// This file implements target-independent rewrites and utilities to emulate
10-
// narrow types that are not supported by the target hardware, e.g. i4, using
11-
// wider types, e.g. i8.
10+
// narrow types that are not supported by the target hardware, e.g. i4
11+
// ("emulated type"), using wider types, e.g. i8 ("container type").
1212
//
1313
/// Currently, only power-of-two integer types are supported. These are
1414
/// converted to wider integers that are either 8 bits wide or wider.
@@ -2022,19 +2022,19 @@ void vector::populateVectorNarrowTypeRewritePatterns(
20222022

20232023
// Patterns for aligned cases. We set higher priority as they are expected to
20242024
// generate better performance for aligned cases.
2025-
// The emulated type is always i8.
2025+
// The container type is always i8.
20262026
patterns.add<RewriteAlignedSubByteIntExt<arith::ExtSIOp, /*isSigned=*/true>,
20272027
RewriteAlignedSubByteIntExt<arith::SIToFPOp, /*isSigned=*/true>,
20282028
RewriteAlignedSubByteIntTrunc>(patterns.getContext(),
20292029
benefit.getBenefit() + 1);
2030-
// The emulated type is always i8.
2030+
// The container type is always i8.
20312031
patterns
20322032
.add<RewriteAlignedSubByteIntExt<arith::ExtUIOp, /*isSigned=*/false>,
20332033
RewriteAlignedSubByteIntExt<arith::UIToFPOp, /*isSigned=*/false>>(
20342034
patterns.getContext(), benefit.getBenefit() + 1);
20352035
}
20362036

2037-
// The emulated type is always i8.
2037+
// The container type is always i8.
20382038
void vector::populateVectorTransposeNarrowTypeRewritePatterns(
20392039
RewritePatternSet &patterns, PatternBenefit benefit) {
20402040
patterns.add<RewriteVectorTranspose>(patterns.getContext(), benefit);

0 commit comments

Comments
 (0)