[PATCH] D80017: [mlir] Fix incorrect indexing of subview in DimOp folding.
Mahesh Ravishankar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 15 10:18:28 PDT 2020
mravishankar accepted this revision.
mravishankar added inline comments.
================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:1344
if (auto subview = dyn_cast_or_null<SubViewOp>(memref)) {
- auto sizes = subview.sizes();
- if (!sizes.empty())
- return *(sizes.begin() + getIndex());
+ assert(subview.isDynamicSize(getIndex()) &&
+ "Expected dynamic subview size");
----------------
Does this has to be an assert? Is it possible that the subview op has been canonicalized, but the dim op hasnt in which case the subview op will have a static size. You can just return {} if it is not dynamic for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80017/new/
https://reviews.llvm.org/D80017
More information about the llvm-commits
mailing list