aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorMatthias Gehre <matthias.gehre@amd.com>2025-01-20 13:42:18 +0100
committerGitHub <noreply@github.com>2025-01-20 13:42:18 +0100
commit5ce271ef74dd3325993c827f496e460ced41af11 (patch)
tree31c77f466ec6577bdd67a486f242737be6234003 /llvm/lib/Bitcode/Reader
parentd70f54f248853f4d5f9e71a51dfda53a47f0b7d3 (diff)
downloadllvm-5ce271ef74dd3325993c827f496e460ced41af11.zip
llvm-5ce271ef74dd3325993c827f496e460ced41af11.tar.gz
llvm-5ce271ef74dd3325993c827f496e460ced41af11.tar.bz2
[MLIR] TosaToLinalgNamed: Lower unsigned tosa.max_pool2d (#123290)
This PR allows to lower **unsigned** `tosa.max_pool2d` to linalg. ``` // CHECK-LABEL: @max_pool_ui8 func.func @max_pool_ui8(%arg0: tensor<1x6x34x62xui8>) -> tensor<1x4x32x62xui8> { // CHECK: builtin.unrealized_conversion_cast {{.*}} : tensor<1x6x34x62xui8> to tensor<1x6x34x62xi8> // CHECK: arith.constant 0 // CHECK: linalg.pooling_nhwc_max_unsigned {{.*}} : (tensor<1x4x32x62xi8>) -> tensor<1x4x32x62xi8> // CHECK: builtin.unrealized_conversion_cast {{.*}} : tensor<1x4x32x62xi8> to tensor<1x4x32x62xui8> %0 = tosa.max_pool2d %arg0 {pad = array<i64: 0, 0, 0, 0>, kernel = array<i64: 3, 3>, stride = array<i64: 1, 1>} : (tensor<1x6x34x62xui8>) -> tensor<1x4x32x62xui8> return %0 : tensor<1x4x32x62xui8> } ``` It does this by - converting the MaxPool2dConverter from OpRewriterPattern to OpConversion Pattern - adjusting the padding value to the the minimum unsigned value when the max_pool is unsigned - lowering to `linalg.pooling_nhwc_max_unsigned` (which uses `arith.maxui`) when the max_pool is unsigned
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
0 files changed, 0 insertions, 0 deletions