diff options
| author | Uday Bondhugula <bondhugula@google.com> | 2019-02-04 13:48:44 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 16:12:25 -0700 |
| commit | 0f50414fa4553b1277684cb1dded84b334b35d51 (patch) | |
| tree | 8efb3362ecfc6ec22121492bd5ab03d9340db447 /mlir/lib/Transforms/MemRefDataFlowOpt.cpp | |
| parent | 99d6ee02b98b28fb6501e5ae805842a20b94ec4c (diff) | |
| download | bcm5719-llvm-0f50414fa4553b1277684cb1dded84b334b35d51.tar.gz bcm5719-llvm-0f50414fa4553b1277684cb1dded84b334b35d51.zip | |
Refactor common code getting memref access in getMemRefRegion - NFC
- use getAccessMap() instead of repeating it
- fold getMemRefRegion into MemRefRegion ctor (more natural, avoid heap
allocation and unique_ptr where possible)
- change extractForInductionVars - MutableArrayRef -> ArrayRef for the
arguments. Since the method is just returning copies of 'Value *', the client
can't mutate the pointers themselves; it's fine to mutate the 'Value''s
themselves, but that doesn't mutate the pointers to those.
- change the way extractForInductionVars returns (see b/123437690)
PiperOrigin-RevId: 232359277
Diffstat (limited to 'mlir/lib/Transforms/MemRefDataFlowOpt.cpp')
| -rw-r--r-- | mlir/lib/Transforms/MemRefDataFlowOpt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp index b2b69dc7b6d..2d06a327315 100644 --- a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp +++ b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp @@ -178,8 +178,9 @@ void MemRefDataFlowOpt::visitInstruction(Instruction *opInst) { // is trivially loading from a single location at that depth; so there // isn't a need to call isRangeOneToOne. if (getNestingDepth(*storeOpInst) < loadOpDepth) { - auto region = getMemRefRegion(loadOpInst, nsLoops); - if (!region->getConstraints()->isRangeOneToOne( + MemRefRegion region(loadOpInst->getLoc()); + region.compute(loadOpInst, nsLoops); + if (!region.getConstraints()->isRangeOneToOne( /*start=*/0, /*limit=*/loadOp->getMemRefType().getRank())) break; } |

