From dfe07b7bf6077040cbb2b4392cbd81dc443570b2 Mon Sep 17 00:00:00 2001 From: Uday Bondhugula Date: Fri, 22 Feb 2019 16:51:08 -0800 Subject: Refactor AffineExprFlattener and move FlatAffineConstraints out of IR into Analysis - NFC - refactor AffineExprFlattener (-> SimpleAffineExprFlattener) so that it doesn't depend on FlatAffineConstraints, and so that FlatAffineConstraints could be moved out of IR/; the simplification that the IR needs for AffineExpr's doesn't depend on FlatAffineConstraints - have AffineExprFlattener derive from SimpleAffineExprFlattener to use for all Analysis/Transforms purposes; override addLocalFloorDivId in the derived class - turn addAffineForOpDomain into a method on FlatAffineConstraints - turn AffineForOp::getAsValueMap into an AffineValueMap ctor PiperOrigin-RevId: 235283610 --- mlir/lib/Analysis/LoopAnalysis.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mlir/lib/Analysis/LoopAnalysis.cpp') diff --git a/mlir/lib/Analysis/LoopAnalysis.cpp b/mlir/lib/Analysis/LoopAnalysis.cpp index 545735fd6fd..c0deb805bdf 100644 --- a/mlir/lib/Analysis/LoopAnalysis.cpp +++ b/mlir/lib/Analysis/LoopAnalysis.cpp @@ -23,9 +23,9 @@ #include "mlir/AffineOps/AffineOps.h" #include "mlir/Analysis/AffineAnalysis.h" +#include "mlir/Analysis/AffineStructures.h" #include "mlir/Analysis/NestedMatcher.h" #include "mlir/Analysis/VectorAnalysis.h" -#include "mlir/IR/AffineStructures.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/Instruction.h" @@ -147,8 +147,7 @@ bool mlir::isAccessInvariant(const Value &iv, const Value &index) { auto composeOp = affineApplyOps[0]->cast(); // We need yet another level of indirection because the `dim` index of the // access may not correspond to the `dim` index of composeOp. - return !composeOp->getAsAffineValueMap().isFunctionOf( - 0, const_cast(&iv)); + return !(AffineValueMap(composeOp).isFunctionOf(0, const_cast(&iv))); } llvm::DenseSet -- cgit v1.2.3