[Mlir-commits] [mlir] [Tensor] Simplify tenor.pad tiling length calculations. (PR #119039)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Dec 12 09:28:33 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f9e11501841fc602488fea78b88910eab7d4d396 865958f0c9fc63aa28971d3387d16f2e5f8d84a7 --extensions cpp -- mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp b/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
index 3caf93b140..6e63cf068b 100644
--- a/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
@@ -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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/119039
More information about the Mlir-commits
mailing list