[mlir][Pattern] Add a new FrozenRewritePatternList class

This class represents a rewrite pattern list that has been frozen, and thus immutable. This replaces the uses of OwningRewritePatternList in pattern driver related API, such as dialect conversion. When PDL becomes more prevalent, this API will allow for optimizing a set of patterns once without the need to do this per run of a pass.

Differential Revision: https://reviews.llvm.org/D89104
This commit is contained in:
River Riddle committed 2020-10-26 18:01:06 -07:00
1 parent b6eb26fd0e
commit 3fffffa882
72 files changed
+254 -170

No files matched your search

@@ -1619,7 +1619,7 @@ void LowerVectorToLLVMPass::runOnOperation() {
populateVectorToVectorCanonicalizationPatterns(patterns, &getContext());
populateVectorSlicesLoweringPatterns(patterns, &getContext());
populateVectorContractLoweringPatterns(patterns, &getContext());
applyPatternsAndFoldGreedily(getOperation(), patterns);
applyPatternsAndFoldGreedily(getOperation(), std::move(patterns));
}
// Convert to the LLVM IR dialect.
@@ -1632,7 +1632,8 @@ void LowerVectorToLLVMPass::runOnOperation() {
populateStdToLLVMConversionPatterns(converter, patterns);
LLVMConversionTarget target(getContext());
if (failed(applyPartialConversion(getOperation(), target, patterns)))
if (failed(
applyPartialConversion(getOperation(), target, std::move(patterns))))
signalPassFailure();
}