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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 17 22:42:18 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:

TIL clang-format can format tablegen files! The resulting formatting looks... interesting. And it seems to only kick in with clang-format built in tree? My clang-format 19.1.7 installed from MacPorts doesn't seem to do this formatting.

Can you just manually format this line instead? The GitHub Actions runner [only checks cpp files](https://github.com/llvm/llvm-project/actions/runs/16977178876/job/48128962233?pr=153252#step:9:23) so it should be fine. And maybe we should file an issue for this? The dags should at the very least have spaces between the nodes

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


More information about the llvm-commits mailing list