From 1d3e7e2616b792831f0fc2db632eb1cad5241bfd Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Tue, 9 Oct 2018 16:39:24 -0700 Subject: [MLIR] AffineMap value type This CL applies the same pattern as AffineExpr to AffineMap: a simple struct that acts as the storage is allocated in the bump pointer. The AffineMap is immutable and accessed everywhere by value. PiperOrigin-RevId: 216445930 --- mlir/lib/Transforms/SimplifyAffineExpr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mlir/lib/Transforms/SimplifyAffineExpr.cpp') diff --git a/mlir/lib/Transforms/SimplifyAffineExpr.cpp b/mlir/lib/Transforms/SimplifyAffineExpr.cpp index 30d3908ac33..a3b8ebf1ba8 100644 --- a/mlir/lib/Transforms/SimplifyAffineExpr.cpp +++ b/mlir/lib/Transforms/SimplifyAffineExpr.cpp @@ -59,10 +59,10 @@ PassResult SimplifyAffineExpr::runOnMLFunction(MLFunction *f) { void visitOperationStmt(OperationStmt *opStmt) { for (auto attr : opStmt->getAttrs()) { if (auto *mapAttr = dyn_cast(attr.second)) { - MutableAffineMap mMap(mapAttr->getValue(), context); + MutableAffineMap mMap(mapAttr->getValue()); mMap.simplify(); - auto *map = mMap.getAffineMap(); - opStmt->setAttr(attr.first, AffineMapAttr::get(map, context)); + auto map = mMap.getAffineMap(); + opStmt->setAttr(attr.first, AffineMapAttr::get(map)); } } } -- cgit v1.2.3