[llvm] [WebAssembly] Add support for avgr_u in loops (PR #153252)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 22:53:12 PDT 2025


================
@@ -1144,6 +1144,9 @@ def : Pat<(wasm_shr_u
               (vec.splat (i32 1))),
             (i32 1)),
           (inst $lhs, $rhs)>;
+
+def : Pat<(vec.vt(avgceilu(vec.vt V128:$lhs), (vec.vt V128:$rhs))), (inst $lhs,
+                                                                        $rhs)>;
----------------
lukel97 wrote:

Nit, the spacing is a bit off here, probably best to split this into one line for the input and one for the output

```suggestion
def : Pat<(vec.vt (avgceilu (vec.vt V128:$lhs), (vec.vt V128:$rhs))),
          (inst $lhs, $rhs)>;
```

https://github.com/llvm/llvm-project/pull/153252


More information about the llvm-commits mailing list