summaryrefslogtreecommitdiffstats
path: root/mlir/test/lib/Transforms
diff options
context:
space:
mode:
authorNicolas Vasilache <ntv@google.com>2019-10-01 05:22:54 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-01 05:23:21 -0700
commite36337a998a6be39d65872eab3e3e2291b6518b9 (patch)
treee91646dbc1371b642869559b80ee036fbcc4c5d3 /mlir/test/lib/Transforms
parentf8ae7396130d7483b7038fa3639751980e8e5dc4 (diff)
downloadbcm5719-llvm-e36337a998a6be39d65872eab3e3e2291b6518b9.tar.gz
bcm5719-llvm-e36337a998a6be39d65872eab3e3e2291b6518b9.zip
Unify Linalg types by using strided memrefs
This CL finishes the implementation of the Linalg + Affine type unification of the [strided memref RFC](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio). As a consequence, the !linalg.view type, linalg::DimOp, linalg::LoadOp and linalg::StoreOp can now disappear and Linalg can use standard types everywhere. PiperOrigin-RevId: 272187165
Diffstat (limited to 'mlir/test/lib/Transforms')
-rw-r--r--mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
index 6efaec30be8..01dfdeeb0c8 100644
--- a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
+++ b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
@@ -35,15 +35,13 @@ void TestMemRefStrideCalculation::runOnFunction() {
llvm::outs() << "Testing: " << getFunction().getName() << "\n";
getFunction().walk([&](AllocOp allocOp) {
auto memrefType = allocOp.getResult()->getType().cast<MemRefType>();
- SmallVector<int64_t, 4> strideVector;
- if (failed(memrefType.getStridesAndOffset(strideVector))) {
+ int64_t offset;
+ SmallVector<int64_t, 4> strides;
+ if (failed(memrefType.getStridesAndOffset(strides, offset))) {
llvm::outs() << "MemRefType " << memrefType << " cannot be converted to "
<< "strided form\n";
return;
}
- ArrayRef<int64_t> strides(strideVector);
- auto offset = strides.back();
- strides = strides.drop_back();
llvm::outs() << "MemRefType offset: ";
if (offset == MemRefType::kDynamicStrideOrOffset)
llvm::outs() << "?";
OpenPOWER on IntegriCloud