diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h b/mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h --- a/mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h +++ b/mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h @@ -152,12 +152,16 @@ /// Options to control the application of late transformations. struct LateCodegenStrategyOptions { + /// Hoisting transformations are always deemed beneficial and must disabled + /// explicitly. bool enableLICM = true; bool enableHoistRedundantVectorTransfers = true; bool enableHoistRedundantVectorTransfersOnTensor = true; - bool enableVectorTransferPartialRewrite = true; - bool enableVectorContractLowering = true; - bool enableVectorToSCFConversion = true; + /// Vector lowering operations may result in surprising behavior when + /// composing multiple codegen strategies and must be enabled explicitly. + bool enableVectorTransferPartialRewrite = false; + bool enableVectorContractLowering = false; + bool enableVectorToSCFConversion = false; }; /// Codegen strategy controls how a Linalg op is progressively lowered. diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp @@ -148,6 +148,9 @@ .setAlignment(16) .setUseFullTileBuffersByDefault(registerPromoteFullTile)) .vectorizeIf(vectorize, anchorOpName) + .setEnableVectorTransferPartialRewrite(true) + .setEnableVectorContractLowering(true) + .setEnableVectorToSCFConversion(true) .setVectorTransformsOptions( vector::VectorTransformsOptions() .setVectorTransformsOptions(vectorContractLowering) @@ -177,6 +180,9 @@ .setAlignment(16) .setUseFullTileBuffersByDefault(registerPromoteFullTile)) .template vectorizeIf(vectorize) + .setEnableVectorTransferPartialRewrite(true) + .setEnableVectorContractLowering(true) + .setEnableVectorToSCFConversion(true) .setVectorTransformsOptions( vector::VectorTransformsOptions() .setVectorTransformsOptions(vectorContractLowering)