[mlir][vector] Linearization: push 'bit width' logic out of patterns … · llvm/llvm-project@bad8bf5 (original) (raw)
`@@ -406,18 +406,29 @@ void populateVectorNarrowTypeRewritePatterns(RewritePatternSet &patterns,
`
406
406
`void populateVectorTransposeNarrowTypeRewritePatterns(
`
407
407
` RewritePatternSet &patterns, PatternBenefit benefit = 1);
`
408
408
``
409
``
`-
/// Populates patterns for ND vectors (N >= 2) linearization and sets up the
`
410
``
`-
/// provided ConversionTarget with the appropriate legality configuration for
`
411
``
`-
/// the ops to get converted properly.
`
412
``
`-
void populateVectorLinearizeTypeConversionsAndLegality(
`
413
``
`-
TypeConverter &typeConverter, RewritePatternSet &patterns,
`
414
``
`-
ConversionTarget &target, unsigned targetBitWidth);
`
415
``
-
416
``
`-
/// Populates patterns for linearizing ND (N >= 2) vector operations to 1D
`
417
``
`-
/// vector shuffle operations.
`
418
``
`-
void populateVectorLinearizeShuffleLikeOpsPatterns(
`
419
``
`-
const TypeConverter &typeConverter, RewritePatternSet &patterns,
`
420
``
`-
ConversionTarget &target, unsigned targetBitWidth);
`
``
409
`` +
/// Initialize typeConverter
and conversionTarget
for vector linearization.
``
``
410
`+
/// This registers (1) which operations are legal and hence should not be
`
``
411
`+
/// linearized, (2) what converted types are (rank-1 vectors) and how to
`
``
412
`+
/// materialze the conversion (with shape_cast)
`
``
413
`+
///
`
``
414
`+
/// Note: the set of legal operations can be extended by a user if for example
`
``
415
`+
/// certain rank>1 vectors are considered valid, but adding additional
`
``
416
`` +
/// dynamically legal ops to conversionTarget
.
``
``
417
`+
void populateForVectorLinearize(TypeConverter &typeConverter,
`
``
418
`+
ConversionTarget &conversionTarget);
`
``
419
+
``
420
`` +
/// Populates patterns
for ND vector (N >= 2) linearization. This currently
``
``
421
`+
/// contains patterns for converting ConstantLike, Vectorizable, and
`
``
422
`+
/// vector::BitCast ops.
`
``
423
`+
void populateVectorLinearizeBasePatterns(const TypeConverter &,
`
``
424
`+
const ConversionTarget &,
`
``
425
`+
RewritePatternSet &patterns);
`
``
426
+
``
427
`` +
/// Populates patterns
for linearizing ND (N >= 2) vector operations
``
``
428
`+
/// to 1D vector shuffle operations.
`
``
429
`+
void populateVectorLinearizeShuffleLikeOpsPatterns(const TypeConverter &,
`
``
430
`+
const ConversionTarget &,
`
``
431
`+
RewritePatternSet &patterns);
`
421
432
``
422
433
`} // namespace vector
`
423
434
`} // namespace mlir
`