diff options
| author | Uday Bondhugula <bondhugula@google.com> | 2019-01-09 20:00:19 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 15:07:10 -0700 |
| commit | 742c37abc9ae0eb72bbfebe07042af33699715f9 (patch) | |
| tree | 3ec44f28498c311a2add2fc4ec318ccfa04c7b58 /mlir/lib/Transforms/PipelineDataTransfer.cpp | |
| parent | e49e10e4de1dde2c1ac0c1776c5be920d91925ec (diff) | |
| download | bcm5719-llvm-742c37abc9ae0eb72bbfebe07042af33699715f9.tar.gz bcm5719-llvm-742c37abc9ae0eb72bbfebe07042af33699715f9.zip | |
Fix DMA overlap pass buffer mapping
- the double buffer should be indexed (iv floordiv step) % 2 and NOT (iv % 2);
step wasn't being accounted for.
- fix test cases, enable failing test cases
PiperOrigin-RevId: 228635726
Diffstat (limited to 'mlir/lib/Transforms/PipelineDataTransfer.cpp')
| -rw-r--r-- | mlir/lib/Transforms/PipelineDataTransfer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Transforms/PipelineDataTransfer.cpp index 33523df1b4d..495c9c181fd 100644 --- a/mlir/lib/Transforms/PipelineDataTransfer.cpp +++ b/mlir/lib/Transforms/PipelineDataTransfer.cpp @@ -118,8 +118,9 @@ static bool doubleBuffer(Value *oldMemRef, ForInst *forInst) { // Create 'iv mod 2' value to index the leading dimension. auto d0 = bInner.getAffineDimExpr(0); - auto modTwoMap = - bInner.getAffineMap(/*dimCount=*/1, /*symbolCount=*/0, {d0 % 2}, {}); + int64_t step = forInst->getStep(); + auto modTwoMap = bInner.getAffineMap(/*dimCount=*/1, /*symbolCount=*/0, + {d0.floorDiv(step) % 2}, {}); auto ivModTwoOp = bInner.create<AffineApplyOp>(forInst->getLoc(), modTwoMap, forInst); |

