[PATCH] D95125: [WebAssembly] Enable loop unrolling

Alon Zakai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 06:34:04 PST 2021


kripken added a comment.

In D95125#2522493 <https://reviews.llvm.org/D95125#2522493>, @SjoerdMeijer wrote:

> Webassembly and runtimes is not my field, just saying so you can take my remarks with a bit (or a lot) of salt, but I do have a few opinions on loop-unrolling. :-)
> I look at this problem slightly differently:
>
>> What concerns me is that some existing users will definitely be harmed by this, if the default for -O2 changes.
>
> I.e., the way I look at this is that we deliver on of its promises:
>
>> WebAssembly aims to execute at native speed by taking advantage of common hardware capabilities available on a wide range of platforms.
>
> If this is the goal, if we want parity with native execution, that means we would have to apply the same tricks as ahead of time compiled code, otherwise we would never achieve this. Loop-unrolling is known to greatly improve performance, and also to be an enabler for other optimisations. Thus, without loop-unrolling I don't think near native execution speeds will be feasible.

Well said, I agree.

But I think the question is where loop unrolling is done: on the wasm producer (LLVM) or the wasm consumer (the VM that runs it). As mentioned earlier VMs are working on this, and the benefit of them doing it is that code size matters quite a bit on wasm, and doing it there would be better.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95125/new/

https://reviews.llvm.org/D95125



More information about the llvm-commits mailing list