Skip to content

Commit a522c22

Browse files
authored
[mlir][vector] Move tests for rewriteAlignedSubByteInt{Ext|Trunc} (nfc) (#126416)
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 cdfcce4 commit a522c22

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.
@@ -2063,19 +2063,19 @@ void vector::populateVectorNarrowTypeRewritePatterns(
20632063

20642064
// Patterns for aligned cases. We set higher priority as they are expected to
20652065
// generate better performance for aligned cases.
2066-
// The emulated type is always i8.
2066+
// The container type is always i8.
20672067
patterns.add<RewriteAlignedSubByteIntExt<arith::ExtSIOp, /*isSigned=*/true>,
20682068
RewriteAlignedSubByteIntExt<arith::SIToFPOp, /*isSigned=*/true>,
20692069
RewriteAlignedSubByteIntTrunc>(patterns.getContext(),
20702070
benefit.getBenefit() + 1);
2071-
// The emulated type is always i8.
2071+
// The container type is always i8.
20722072
patterns
20732073
.add<RewriteAlignedSubByteIntExt<arith::ExtUIOp, /*isSigned=*/false>,
20742074
RewriteAlignedSubByteIntExt<arith::UIToFPOp, /*isSigned=*/false>>(
20752075
patterns.getContext(), benefit.getBenefit() + 1);
20762076
}
20772077

2078-
// The emulated type is always i8.
2078+
// The container type is always i8.
20792079
void vector::populateVectorTransposeNarrowTypeRewritePatterns(
20802080
RewritePatternSet &patterns, PatternBenefit benefit) {
20812081
patterns.add<RewriteVectorTranspose>(patterns.getContext(), benefit);

0 commit comments

Comments
 (0)