summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/MaterializeVectors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Transforms/MaterializeVectors.cpp')
-rw-r--r--mlir/lib/Transforms/MaterializeVectors.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/mlir/lib/Transforms/MaterializeVectors.cpp b/mlir/lib/Transforms/MaterializeVectors.cpp
index 2744b1d624c..432ad1f39b8 100644
--- a/mlir/lib/Transforms/MaterializeVectors.cpp
+++ b/mlir/lib/Transforms/MaterializeVectors.cpp
@@ -201,9 +201,6 @@ struct MaterializeVectorsPass : public FunctionPass {
PassResult runOnFunction(Function *f) override;
- // Thread-safe RAII contexts local to pass, BumpPtrAllocator freed on exit.
- NestedPatternContext mlContext;
-
static char passID;
};
@@ -744,6 +741,9 @@ static bool materialize(Function *f,
}
PassResult MaterializeVectorsPass::runOnFunction(Function *f) {
+ // Thread-safe RAII local context, BumpPtrAllocator freed on exit.
+ NestedPatternContext mlContext;
+
// TODO(ntv): Check to see if this supports arbitrary top-level code.
if (f->getBlocks().size() != 1)
return success();
@@ -768,10 +768,11 @@ PassResult MaterializeVectorsPass::runOnFunction(Function *f) {
return matcher::operatesOnSuperVectors(opInst, subVectorType);
};
auto pat = Op(filter);
- auto matches = pat.match(f);
+ SmallVector<NestedMatch, 8> matches;
+ pat.match(f, &matches);
SetVector<OperationInst *> terminators;
for (auto m : matches) {
- terminators.insert(cast<OperationInst>(m.first));
+ terminators.insert(cast<OperationInst>(m.getMatchedInstruction()));
}
auto fail = materialize(f, terminators, &state);
OpenPOWER on IntegriCloud