Skip to content

Commit

Permalink
Populate default wraps, if wraps list is empty (Xilinx#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
erwei-xilinx authored Nov 1, 2024
1 parent 3d1a4e1 commit e3a7253
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mlir/lib/Transform/AIRMiscPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,13 @@ void AIRSplitL2MemrefForBufferConstraintPass::runOnOperation() {

// Account for cases where rank reduction results from at least
// of the dimensions being equal to one.
auto wraps = theOtherChanOp[0].getSizes();
SmallVector<Value> wraps = theOtherChanOp[0].getSizes();
if (wraps.empty()) {
// Populate default wraps, if wraps is an empty vector.
SmallVector<Value> offsets, strides;
air::populateDefaultWrapsAndStrides(
builder, theOtherChanOp[0].getMemref(), offsets, wraps, strides);
}
auto adjustedDimIdx = dim;
if (wraps.size() != memrefShape.size()) {
// Make sure that the number of rank-reducing dimensions and/or
Expand Down Expand Up @@ -1613,6 +1619,13 @@ void AIRSplitL2MemrefForBufferConstraintPass::runOnOperation() {
}
}

if (adjustedDimIdx >= (int)wraps.size()) {
theOtherChanOp[0]->emitOpError(
"Failed to split data access pattern due to air.channel op "
"having mismatching wraps rank.");
return;
}

Value newWaitAll1 =
tileChannelOpByFactor(theOtherChanOp[0], targetColTilingFactor,
*getConstantIntValue(wraps[adjustedDimIdx]),
Expand Down

0 comments on commit e3a7253

Please sign in to comment.