diff options
author | Nirvedh Meshram <96096277+nirvedhmeshram@users.noreply.github.com> | 2025-04-18 12:21:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-18 12:21:37 -0500 |
commit | 23020a8d01a3f58e4903c42eba4b803d5809653e (patch) | |
tree | 11b237b352af79d6865bce7b9c0ba5437eb69733 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 61820156980ff20ca6e8a7a43a1e9debb950db85 (diff) | |
download | llvm-23020a8d01a3f58e4903c42eba4b803d5809653e.zip llvm-23020a8d01a3f58e4903c42eba4b803d5809653e.tar.gz llvm-23020a8d01a3f58e4903c42eba4b803d5809653e.tar.bz2 |
[mlir] Add optimization to bubbleUpPadSlice pattern for no pad case (#135859)
In cases where there is no padding on a dim, we do not need to compute
new offsets, lengths and padding, for example the new test case added
can just be lowered to
```
%extracted_slice = tensor.extract_slice %arg0[%arg2, 1, 2] [%arg2, 2, 1] [1, 1, 1] : tensor<3x4x5xf32> to tensor<?x2x1xf32>
```
without this PR we will have affine maps like
```
#map = affine_map<()[s0] -> (3, s0)>
#map1 = affine_map<()[s0, s1] -> (-s0 + 3, s1)>
%0 = affine.min #map()[%arg2]
%1 = affine.min #map1()[%0, %arg2]
%extracted_slice = tensor.extract_slice %arg0[%0, 1, 2] [%1, 2, 1] [1, 1, 1] : tensor<3x4x5xf32> to tensor<?x2x1xf32>
```
which are unnecessary
Signed-off-by: Nirvedh <nirvedh@gmail.com>
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions