summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
diff options
context:
space:
mode:
authorUday Bondhugula <bondhugula@google.com>2019-02-04 07:58:42 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:09:52 -0700
commitb26900dce55c93043e8f84580df4a1bec65408be (patch)
treee752280cbe8f34910fb950f4104f35357f844a5f /mlir/lib/Transforms/MemRefDataFlowOpt.cpp
parent870d7783503962a7043b2654ab82a9d4f4f1a961 (diff)
downloadbcm5719-llvm-b26900dce55c93043e8f84580df4a1bec65408be.tar.gz
bcm5719-llvm-b26900dce55c93043e8f84580df4a1bec65408be.zip
Update dma-generate pass to (1) work on blocks of instructions (instead of just
loops), (2) take into account fast memory space capacity and lower 'dmaDepth' to fit, (3) add location information for debug info / errors - change dma-generate pass to work on blocks of instructions (start/end iterators) instead of 'for' loops; complete TODOs - allows DMA generation for straightline blocks of operation instructions interspersed b/w loops - take into account fast memory capacity: check whether memory footprint fits in fastMemoryCapacity parameter, and recurse/lower the depth at which DMA generation is performed until it does fit in the provided memory - add location information to MemRefRegion; any insufficient fast memory capacity errors or debug info w.r.t dma generation shows location information - allow DMA generation pass to be instantiated with a fast memory capacity option (besides command line flag) - change getMemRefRegion to return unique_ptr's - change getMemRefFootprintBytes to work on a 'Block' instead of 'ForInst' - other helper methods; add postDomInstFilter option for replaceAllMemRefUsesWith; drop forInst->walkOps, add Block::walkOps methods Eg. output $ mlir-opt -dma-generate -dma-fast-mem-capacity=1 /tmp/single.mlir /tmp/single.mlir:9:13: error: Total size of all DMA buffers' for this block exceeds fast memory capacity for %i3 = (d0) -> (d0)(%i1) to (d0) -> (d0 + 32)(%i1) { ^ $ mlir-opt -debug-only=dma-generate -dma-generate -dma-fast-mem-capacity=400 /tmp/single.mlir /tmp/single.mlir:9:13: note: 8 KiB of DMA buffers in fast memory space for this block for %i3 = (d0) -> (d0)(%i1) to (d0) -> (d0 + 32)(%i1) { PiperOrigin-RevId: 232297044
Diffstat (limited to 'mlir/lib/Transforms/MemRefDataFlowOpt.cpp')
-rw-r--r--mlir/lib/Transforms/MemRefDataFlowOpt.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
index 4191a9cc279..e6ce273b532 100644
--- a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
+++ b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
@@ -178,9 +178,8 @@ void MemRefDataFlowOpt::visitOperationInst(OperationInst *opInst) {
// is trivially loading from a single location at that depth; so there
// isn't a need to call isRangeOneToOne.
if (getNestingDepth(*storeOpInst) < loadOpDepth) {
- MemRefRegion region;
- getMemRefRegion(loadOpInst, nsLoops, &region);
- if (!region.getConstraints()->isRangeOneToOne(
+ auto region = getMemRefRegion(loadOpInst, nsLoops);
+ if (!region->getConstraints()->isRangeOneToOne(
/*start=*/0, /*limit=*/loadOp->getMemRefType().getRank()))
break;
}
OpenPOWER on IntegriCloud