File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed
include/mlir/Dialect/Linalg/Transforms
lib/Dialect/Linalg/Transforms Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,10 @@ struct CodegenStrategy {
224
224
.enableHoistRedundantVectorTransfersOnTensor = val;
225
225
return *this ;
226
226
}
227
+ CodegenStrategy &setMaxTransferRank (int64_t val) {
228
+ this ->lateCodegenStrategyOptions .maxTransferRank = val;
229
+ return *this ;
230
+ }
227
231
CodegenStrategy &setEnableVectorTransferPartialRewrite (bool val) {
228
232
this ->lateCodegenStrategyOptions .enableVectorTransferPartialRewrite = val;
229
233
return *this ;
Original file line number Diff line number Diff line change @@ -835,6 +835,7 @@ struct LateCodegenStrategyOptions {
835
835
bool enableHoistRedundantVectorTransfersOnTensor = true ;
836
836
// / Vector lowering operations may result in surprising behavior when
837
837
// / composing multiple codegen strategies and must be enabled explicitly.
838
+ int64_t maxTransferRank = 1 ;
838
839
bool enableVectorTransferPartialRewrite = false ;
839
840
bool enableVectorContractLowering = false ;
840
841
bool enableVectorToSCFConversion = false ;
@@ -852,6 +853,7 @@ struct LinalgEnablingOptions {
852
853
// / Vector lowering options control how ops are lowered down to 1-D and scf.for
853
854
// / form.
854
855
struct LinalgVectorLoweringOptions {
856
+ int64_t maxTransferRank = 1 ;
855
857
bool enableVectorTransferPartialRewrite = false ;
856
858
bool enableVectorContractLowering = false ;
857
859
bool enableVectorToSCFConversion = false ;
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ void mlir::linalg::CodegenStrategy::configurePassPipeline(
47
47
pm.addPass (createLinalgStrategyEnablePass ());
48
48
}
49
49
LinalgVectorLoweringOptions vectorLoweringOptions;
50
+ vectorLoweringOptions.maxTransferRank =
51
+ lateCodegenStrategyOptions.maxTransferRank ;
50
52
vectorLoweringOptions.enableVectorTransferPartialRewrite =
51
53
lateCodegenStrategyOptions.enableVectorTransferPartialRewrite ;
52
54
vectorLoweringOptions.enableVectorContractLowering =
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ struct LinalgStrategyLowerVectorsPass
260
260
261
261
MLIRContext *context = funcOp.getContext ();
262
262
RewritePatternSet patterns (context);
263
+ vector::populateVectorTransferLoweringPatterns (patterns,
264
+ options.maxTransferRank );
263
265
if (options.enableVectorTransferPartialRewrite ) {
264
266
patterns.add <vector::VectorTransferFullPartialRewriter>(
265
267
context, options.vectorTransformOptions );
You can’t perform that action at this time.
0 commit comments