Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,13 @@ FailureOr<TilingResult> tensor::bubbleUpPadSlice(OpBuilder &b,
// the source tensor. (Similar to newOffset.)
// srcSize - newOffset represents how much length we have available
// and length - newLow represents how much length we want at most.
// Note that there are many ways to order this indexing math to compute newLength, but we want to make sure that the final affine.min ops in the sequence are bounding the index to as small a value as possible. If ValueBoundsOpInterface is used, this calcuation will get upper bounds from the affine.min ops, so we want to use the smallest known value to set the bound at the end of the computation sequence. In this case, the index will be upper bounded by length - newLow.
// Note that there are many ways to order this indexing math to compute
// newLength, but we want to make sure that the final affine.min ops in the
// sequence are bounding the index to as small a value as possible. If
// ValueBoundsOpInterface is used, this calcuation will get upper bounds
// from the affine.min ops, so we want to use the smallest known value to
// set the bound at the end of the computation sequence. In this case, the
// index will be upper bounded by length - newLow.
OpFoldResult newLength = min(sub(srcSize, newOffset), sub(length, newLow));
// Optimization: If low = 0, then newLow = 0. then newLength >= 0 assuming
// length >= 0.
Expand Down
Loading