summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Quantizer/Transforms
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-08-05 18:37:56 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-08-05 18:38:22 -0700
commita0df3ebd15e84eab052ebf1f9e8cd4e561f7b4aa (patch)
treec213b80e754258a3998d50d38afa84a792951bea /mlir/lib/Quantizer/Transforms
parent3657966e839125bd26edbdf00c874ad1868b038a (diff)
downloadbcm5719-llvm-a0df3ebd15e84eab052ebf1f9e8cd4e561f7b4aa.tar.gz
bcm5719-llvm-a0df3ebd15e84eab052ebf1f9e8cd4e561f7b4aa.zip
NFC: Implement OwningRewritePatternList as a class instead of a using directive.
This allows for proper forward declaration, as opposed to leaking the internal implementation via a using directive. This also allows for all pattern building to go through 'insert' methods on the OwningRewritePatternList, replacing uses of 'push_back' and 'RewriteListBuilder'. PiperOrigin-RevId: 261816316
Diffstat (limited to 'mlir/lib/Quantizer/Transforms')
-rw-r--r--mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp b/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
index 6b376db8516..3de89137c3c 100644
--- a/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
+++ b/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
@@ -60,12 +60,9 @@ void RemoveInstrumentationPass::runOnFunction() {
OwningRewritePatternList patterns;
auto func = getFunction();
auto *context = &getContext();
- patterns.push_back(
- llvm::make_unique<RemoveIdentityOpRewrite<StatisticsOp>>(context));
- patterns.push_back(
- llvm::make_unique<RemoveIdentityOpRewrite<StatisticsRefOp>>(context));
- patterns.push_back(
- llvm::make_unique<RemoveIdentityOpRewrite<CoupledRefOp>>(context));
+ patterns.insert<RemoveIdentityOpRewrite<StatisticsOp>,
+ RemoveIdentityOpRewrite<StatisticsRefOp>,
+ RemoveIdentityOpRewrite<CoupledRefOp>>(context);
applyPatternsGreedily(func, std::move(patterns));
}
OpenPOWER on IntegriCloud