summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Analysis')
-rw-r--r--mlir/lib/Analysis/AffineAnalysis.cpp13
-rw-r--r--mlir/lib/Analysis/AffineStructures.cpp5
-rw-r--r--mlir/lib/Analysis/Liveness.cpp2
-rw-r--r--mlir/lib/Analysis/Utils.cpp4
4 files changed, 14 insertions, 10 deletions
diff --git a/mlir/lib/Analysis/AffineAnalysis.cpp b/mlir/lib/Analysis/AffineAnalysis.cpp
index 2608452771f..5ea87f6bc56 100644
--- a/mlir/lib/Analysis/AffineAnalysis.cpp
+++ b/mlir/lib/Analysis/AffineAnalysis.cpp
@@ -117,6 +117,7 @@ static LogicalResult getInstIndexSet(Operation *op,
return getIndexSet(loops, indexSet);
}
+namespace {
// ValuePositionMap manages the mapping from Values which represent dimension
// and symbol identifiers from 'src' and 'dst' access functions to positions
// in new space where some Values are kept separate (using addSrc/DstValue)
@@ -195,6 +196,7 @@ private:
DenseMap<Value, unsigned> dstDimPosMap;
DenseMap<Value, unsigned> symbolPosMap;
};
+} // namespace
// Builds a map from Value to identifier position in a new merged identifier
// list, which is the result of merging dim/symbol lists from src/dst
@@ -240,12 +242,11 @@ static void buildDimAndSymbolPositionMaps(
// Sets up dependence constraints columns appropriately, in the format:
// [src-dim-ids, dst-dim-ids, symbol-ids, local-ids, const_term]
-void initDependenceConstraints(const FlatAffineConstraints &srcDomain,
- const FlatAffineConstraints &dstDomain,
- const AffineValueMap &srcAccessMap,
- const AffineValueMap &dstAccessMap,
- const ValuePositionMap &valuePosMap,
- FlatAffineConstraints *dependenceConstraints) {
+static void initDependenceConstraints(
+ const FlatAffineConstraints &srcDomain,
+ const FlatAffineConstraints &dstDomain, const AffineValueMap &srcAccessMap,
+ const AffineValueMap &dstAccessMap, const ValuePositionMap &valuePosMap,
+ FlatAffineConstraints *dependenceConstraints) {
// Calculate number of equalities/inequalities and columns required to
// initialize FlatAffineConstraints for 'dependenceDomain'.
unsigned numIneq =
diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp
index b5e314047b0..97f534a727f 100644
--- a/mlir/lib/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Analysis/AffineStructures.cpp
@@ -1388,8 +1388,9 @@ static void getLowerAndUpperBoundIndices(const FlatAffineConstraints &cst,
// Check if the pos^th identifier can be expressed as a floordiv of an affine
// function of other identifiers (where the divisor is a positive constant).
// For eg: 4q <= i + j <= 4q + 3 <=> q = (i + j) floordiv 4.
-bool detectAsFloorDiv(const FlatAffineConstraints &cst, unsigned pos,
- SmallVectorImpl<AffineExpr> *memo, MLIRContext *context) {
+static bool detectAsFloorDiv(const FlatAffineConstraints &cst, unsigned pos,
+ SmallVectorImpl<AffineExpr> *memo,
+ MLIRContext *context) {
assert(pos < cst.getNumIds() && "invalid position");
SmallVector<unsigned, 4> lbIndices, ubIndices;
diff --git a/mlir/lib/Analysis/Liveness.cpp b/mlir/lib/Analysis/Liveness.cpp
index 26e152dcdf7..dbda9f5ba28 100644
--- a/mlir/lib/Analysis/Liveness.cpp
+++ b/mlir/lib/Analysis/Liveness.cpp
@@ -21,6 +21,7 @@
using namespace mlir;
+namespace {
/// Builds and holds block information during the construction phase.
struct BlockInfoBuilder {
using ValueSetT = Liveness::ValueSetT;
@@ -107,6 +108,7 @@ struct BlockInfoBuilder {
/// The set of all used values.
ValueSetT useValues;
};
+} // namespace
/// Builds the internal liveness block mapping.
static void buildBlockMapping(MutableArrayRef<Region> regions,
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp
index 4991e51d5f0..21ca17dce42 100644
--- a/mlir/lib/Analysis/Utils.cpp
+++ b/mlir/lib/Analysis/Utils.cpp
@@ -471,8 +471,8 @@ static Operation *getInstAtPosition(ArrayRef<unsigned> positions,
}
// Adds loop IV bounds to 'cst' for loop IVs not found in 'ivs'.
-LogicalResult addMissingLoopIVBounds(SmallPtrSet<Value, 8> &ivs,
- FlatAffineConstraints *cst) {
+static LogicalResult addMissingLoopIVBounds(SmallPtrSet<Value, 8> &ivs,
+ FlatAffineConstraints *cst) {
for (unsigned i = 0, e = cst->getNumDimIds(); i < e; ++i) {
auto value = cst->getIdValue(i);
if (ivs.count(value) == 0) {
OpenPOWER on IntegriCloud