Skip to content

Commit

Permalink
Update lit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-Varma committed Aug 27, 2024
1 parent ef387de commit c3eee90
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 133 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ void AMDAIESplitLogicalObjectFifosPass::runOnOperation() {

if (l2ToL1DmaOps.size() == 0) return;

SmallVector<OpFoldResult> baseSourceOffsets = l2ToL1DmaOps[0].getSourceMixedOffsets();
SmallVector<OpFoldResult> baseSourceOffsets =
l2ToL1DmaOps[0].getSourceMixedOffsets();
DenseSet<unsigned> splitDimensionsSet;
for (unsigned i = 1, n = l2ToL1DmaOps.size(); i < n; i++) {
SmallVector<OpFoldResult> sourceOffsets = l2ToL1DmaOps[i].getSourceMixedOffsets();
SmallVector<OpFoldResult> sourceOffsets =
l2ToL1DmaOps[i].getSourceMixedOffsets();
for (unsigned j = 0, m = baseSourceOffsets.size(); j < m; j++) {
if (baseSourceOffsets[j] != sourceOffsets[j]) {
splitDimensionsSet.insert(j);
Expand Down Expand Up @@ -148,11 +150,12 @@ void AMDAIESplitLogicalObjectFifosPass::runOnOperation() {
AffineMap affineMap = applyOp.getAffineMap();
AffineExpr affineExpr = affineMap.getResult(0);
AffineExpr newAffineExpr = affineExpr + offsetToAdd;
auto newAffineMap = AffineMap::get(/*dimCount=*/1, /*symbolCount=*/0, {newAffineExpr}, context);
auto newAffineMap = AffineMap::get(/*dimCount=*/1, /*symbolCount=*/0,
{newAffineExpr}, context);
IRRewriter::InsertPoint oldInsertionPoint = rewriter.saveInsertionPoint();
rewriter.setInsertionPoint(applyOp);
auto newAffineApplyOp = rewriter.create<affine::AffineApplyOp>(
applyOp.getLoc(), newAffineMap, applyOp.getMapOperands());
applyOp.getLoc(), newAffineMap, applyOp.getMapOperands());
rewriter.restoreInsertionPoint(oldInsertionPoint);
staticL3AsSourceOffsets[dim] = newAffineApplyOp.getResult();
}
Expand Down
Loading

0 comments on commit c3eee90

Please sign in to comment.