[PATCH] D77126: Add a method to build affine maps with zero or more results.
Ulysse Beaugnon via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 04:23:59 PDT 2020
ulysseB updated this revision to Diff 253833.
ulysseB added a comment.
Fix comments for AffineMap::get.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77126/new/
https://reviews.llvm.org/D77126
Files:
mlir/include/mlir/IR/AffineMap.h
mlir/lib/IR/MLIRContext.cpp
Index: mlir/lib/IR/MLIRContext.cpp
===================================================================
--- mlir/lib/IR/MLIRContext.cpp
+++ mlir/lib/IR/MLIRContext.cpp
@@ -613,7 +613,7 @@
AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
MLIRContext *context) {
- return getImpl(dimCount, /*symbolCount=*/0, /*results=*/{}, context);
+ return getImpl(dimCount, symbolCount, /*results=*/{}, context);
}
AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
@@ -623,6 +623,11 @@
return getImpl(dimCount, symbolCount, results, results[0].getContext());
}
+AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
+ ArrayRef<AffineExpr> results, MLIRContext *context) {
+ return getImpl(dimCount, symbolCount, results, context);
+}
+
//===----------------------------------------------------------------------===//
// Integer Sets: these are allocated into the bump pointer, and are immutable.
// Unlike AffineMap's, these are uniqued only if they are small.
Index: mlir/include/mlir/IR/AffineMap.h
===================================================================
--- mlir/include/mlir/IR/AffineMap.h
+++ mlir/include/mlir/IR/AffineMap.h
@@ -49,9 +49,16 @@
static AffineMap get(unsigned dimCount, unsigned symbolCount,
MLIRContext *context);
+ /// Returns an affine map with `dimCount` dimensions and `symbolCount` symbols
+ /// mapping to the given results. The array of results cannot be empty.
static AffineMap get(unsigned dimCount, unsigned symbolCount,
ArrayRef<AffineExpr> results);
+ /// Returns an affine map with `dimCount` dimensions and `symbolCount` mapping
+ /// to the given results, where the number of results can be zero.
+ static AffineMap get(unsigned dimCount, unsigned symbolCount,
+ ArrayRef<AffineExpr> results, MLIRContext *context);
+
/// Returns a single constant result affine map.
static AffineMap getConstantMap(int64_t val, MLIRContext *context);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77126.253833.patch
Type: text/x-patch
Size: 2075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200331/6613d39f/attachment-0001.bin>
More information about the llvm-commits
mailing list