diff --git a/build_tools/llvm_version.txt b/build_tools/llvm_version.txt index f9fbb42..f67b7da 100644 --- a/build_tools/llvm_version.txt +++ b/build_tools/llvm_version.txt @@ -1,2 +1,2 @@ -26750a1264b3df114a1efae7cde6f0784206b2ce +0fc1aa22ee6ac337a5d51fa5666c9cd61da61b07 diff --git a/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc b/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc index d2f415d..ce63f6b 100644 --- a/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc +++ b/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc @@ -49,7 +49,7 @@ struct ChloLegalizeToHloPass chlo::PopulateLegalizeChloToHloPatterns(&getContext(), &conversionPatterns); if (failed(applyPartialConversion(getFunction(), conversionTarget, - conversionPatterns))) { + std::move(conversionPatterns)))) { return signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc b/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc index 1ce93b9..1cf3915 100644 --- a/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc +++ b/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc @@ -555,7 +555,8 @@ struct HloLegalizeToLhlo &context, converter, patterns); populateShapeStructuralTypeConversionsAndLegality(&context, converter, patterns, target); - if (failed(applyPartialConversion(getOperation(), target, patterns))) + if (failed(applyPartialConversion(getOperation(), target, + std::move(patterns)))) signalPassFailure(); } diff --git a/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc b/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc index 59cd338..b3722e3 100644 --- a/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc +++ b/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc @@ -17,8 +17,8 @@ limitations under the License. #include "mlir-hlo/Dialect/mhlo/transforms/passes.h" #include "mlir-hlo/Dialect/mhlo/transforms/rewriters.h" #include "mlir/IR/Function.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { @@ -133,7 +133,7 @@ struct LegalizeGatherToTorchIndexSelectPass void runOnFunction() override { OwningRewritePatternList patterns; PopulateGatherToTorchIndexSelectPatterns(&getContext(), &patterns); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } }; } // namespace diff --git a/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc b/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc index 834384e..80d089e 100644 --- a/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc +++ b/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc @@ -893,7 +893,7 @@ struct LhloLegalizeToLinalgPass auto func = getFunction(); populateLHLOToLinalgConversionPattern(func.getContext(), &patterns); - if (failed(applyPartialConversion(func, target, patterns, nullptr))) { + if (failed(applyPartialConversion(func, target, std::move(patterns)))) { signalPassFailure(); } } @@ -912,7 +912,7 @@ struct HloLegalizeToLinalgPass auto func = getFunction(); mhlo::populateHLOToLinalgConversionPattern(func.getContext(), &patterns); - if (failed(applyPartialConversion(func, target, patterns, nullptr))) { + if (failed(applyPartialConversion(func, target, std::move(patterns)))) { signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/legalize_to_standard.cc b/lib/Dialect/mhlo/transforms/legalize_to_standard.cc index 84255c2..0173bcd 100644 --- a/lib/Dialect/mhlo/transforms/legalize_to_standard.cc +++ b/lib/Dialect/mhlo/transforms/legalize_to_standard.cc @@ -21,8 +21,8 @@ limitations under the License. #include "mlir-hlo/Dialect/mhlo/transforms/rewriters.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Function.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace { @@ -201,7 +201,7 @@ void PopulateMhloToStdPatterns(OwningRewritePatternList *patterns, void LegalizeToStandardPass::runOnFunction() { OwningRewritePatternList patterns; mlir::mhlo::PopulateMhloToStdPatterns(&patterns, &getContext()); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } } // end namespace mhlo diff --git a/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc b/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc index 1003086..b9f513f 100644 --- a/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc +++ b/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc @@ -20,8 +20,8 @@ limitations under the License. #include "mlir-hlo/Dialect/mhlo/transforms/rewriters.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Function.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace mhlo { @@ -259,7 +259,7 @@ struct LegalizeTrigonometricToApproximationPass void runOnFunction() override { OwningRewritePatternList patterns; PopulateTrigonometricToApproximationPatterns(&getContext(), &patterns); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } }; diff --git a/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc b/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc index 2329487..da76093 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc @@ -27,6 +27,7 @@ limitations under the License. #include "mlir/Interfaces/ViewLikeInterface.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/FoldUtils.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace lmhlo { @@ -111,7 +112,7 @@ class LhloFuseLinalgPass } }); auto patterns = linalg::getLinalgTilingCanonicalizationPatterns(ctx); - applyPatternsAndFoldGreedily(func, patterns); + applyPatternsAndFoldGreedily(func, std::move(patterns)); // Fuse producers of tiled linalg ops. llvm::SmallDenseSet erase_set; @@ -132,7 +133,7 @@ class LhloFuseLinalgPass } auto patterns = linalg::getLinalgTilingCanonicalizationPatterns(ctx); - applyPatternsAndFoldGreedily(func, patterns); + applyPatternsAndFoldGreedily(func, std::move(patterns)); } for (auto* e : erase_set) e->erase(); } diff --git a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc index 2041d22..5bd27f0 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc @@ -19,12 +19,10 @@ limitations under the License. #include "mlir-hlo/Dialect/mhlo/transforms/map_lmhlo_to_scalar_op.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" -#include "mlir/IR/Attributes.h" #include "mlir/IR/Location.h" -#include "mlir/IR/MLIRContext.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/IR/StandardTypes.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace lmhlo { @@ -160,7 +158,7 @@ struct LhloLegalizeToAffinePass OwningRewritePatternList patterns; auto func = getFunction(); populateLHLOToAffineConversionPattern(func.getContext(), &patterns); - applyPatternsAndFoldGreedily(func, patterns); + applyPatternsAndFoldGreedily(func, std::move(patterns)); } }; diff --git a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc index fbade8f..ea3eea0 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc @@ -184,7 +184,7 @@ struct LhloLegalizeToGpuPass target.addIllegalOp(); auto func = getFunction(); patterns.insert(func.getContext()); - if (failed(applyPartialConversion(func, target, patterns))) { + if (failed(applyPartialConversion(func, target, std::move(patterns)))) { signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc index 3d49027..6b9286a 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc @@ -47,7 +47,7 @@ class TestLhloToLLVMPass target.addLegalOp(); target.addIllegalDialect(); - if (failed(applyFullConversion(m, target, patterns))) { + if (failed(applyFullConversion(m, target, std::move(patterns)))) { signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc index d9a2d99..78d681b 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc @@ -713,7 +713,7 @@ struct LhloLegalizeToParallelLoopsPass target.addIllegalOp(); - if (failed(applyPartialConversion(func, target, patterns))) { + if (failed(applyPartialConversion(func, target, std::move(patterns)))) { signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/lower_complex.cc b/lib/Dialect/mhlo/transforms/lower_complex.cc index 491f1c0..7bea88f 100644 --- a/lib/Dialect/mhlo/transforms/lower_complex.cc +++ b/lib/Dialect/mhlo/transforms/lower_complex.cc @@ -29,11 +29,11 @@ limitations under the License. #include "mlir/IR/Attributes.h" #include "mlir/IR/MLIRContext.h" #include "mlir/IR/Operation.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/IR/Types.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassRegistry.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" using mlir::FunctionPass; using mlir::OwningRewritePatternList; @@ -70,7 +70,7 @@ void LowerComplexPass::runOnFunction() { OwningRewritePatternList patterns; mlir::mhlo::PopulateComplexLoweringPatterns(&getContext(), &patterns); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } std::unique_ptr mlir::mhlo::createLowerComplexPass() { diff --git a/lib/Dialect/mhlo/transforms/lower_general_dot.cc b/lib/Dialect/mhlo/transforms/lower_general_dot.cc index ada30a2..bc70074 100644 --- a/lib/Dialect/mhlo/transforms/lower_general_dot.cc +++ b/lib/Dialect/mhlo/transforms/lower_general_dot.cc @@ -25,10 +25,10 @@ limitations under the License. #include "mlir/IR/Function.h" #include "mlir/IR/Location.h" #include "mlir/IR/Operation.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/IR/StandardTypes.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" using mlir::DenseIntElementsAttr; using mlir::ElementsAttr; @@ -182,7 +182,7 @@ struct LegalizeGeneralDotPass void runOnFunction() override { OwningRewritePatternList patterns; mlir::mhlo::PopulateGeneralDotOpLoweringPatterns(&patterns, &getContext()); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } }; diff --git a/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc b/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc index 3909f04..d410a26 100644 --- a/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc +++ b/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc @@ -42,7 +42,7 @@ struct TestMaterializeBroadcastsPass PopulateMaterializeBroadcastsPatterns(&getContext(), &conversionPatterns); if (failed(applyPartialConversion(getFunction(), conversionTarget, - conversionPatterns))) { + std::move(conversionPatterns)))) { return signalPassFailure(); } } diff --git a/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc b/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc index febd442..62fde5e 100644 --- a/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc +++ b/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc @@ -19,9 +19,9 @@ limitations under the License. #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/MLIRContext.h" #include "mlir/IR/Operation.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" using mlir::FunctionPass; using mlir::PassWrapper; @@ -42,7 +42,7 @@ void OptimizeMhloPass::runOnFunction() { mlir::OwningRewritePatternList patterns; mlir::mhlo::PopulateOptimizeMHLOPatterns(&getContext(), &patterns); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } std::unique_ptr mlir::mhlo::createOptimizeMhloPass() { diff --git a/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc b/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc index 35e5a18..fed7f70 100644 --- a/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc +++ b/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc @@ -17,9 +17,9 @@ limitations under the License. #include "mlir/IR/Identifier.h" #include "mlir/IR/MLIRContext.h" #include "mlir/IR/OperationSupport.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Pass/Pass.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace mhlo { @@ -87,7 +87,7 @@ struct TestInferShapedTypeMethodsPass OwningRewritePatternList patterns; patterns.insert(&getContext()); patterns.insert(&getContext()); - applyPatternsAndFoldGreedily(getFunction(), patterns); + applyPatternsAndFoldGreedily(getFunction(), std::move(patterns)); } }; diff --git a/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc b/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc index 7c01fa2..0dc9f1b 100644 --- a/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc +++ b/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc @@ -154,7 +154,8 @@ struct TransformUnrankedHloPass PopulateTransformUnrankedHloPatterns(&ctx, &patterns); // Apply transformation. - if (failed(applyPartialConversion(getFunction(), target, patterns))) + if (failed( + applyPartialConversion(getFunction(), target, std::move(patterns)))) return signalPassFailure(); } }; diff --git a/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc b/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc index f187a74..19261d4 100644 --- a/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc +++ b/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc @@ -18,9 +18,9 @@ limitations under the License. #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/MLIRContext.h" #include "mlir/IR/Operation.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" +#include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { namespace mhlo { @@ -32,7 +32,7 @@ struct TestUnfuseBatchNormPass void runOnOperation() override { OwningRewritePatternList patterns; PopulateUnfuseBatchNormPatterns(&getContext(), &patterns); - applyPatternsAndFoldGreedily(getOperation(), patterns); + applyPatternsAndFoldGreedily(getOperation(), std::move(patterns)); } };