Hi Emanuel,

I actually enabled loop unrolling for Wasm, in LLVM, for this same reason. 
The Turboshaft unroller doesn't appear to be triggering for the one loop I 
looked at, as I think it's too big. I have tweaked the TS unroller 
heuristics to generally unroll less, as added the compilation time was 
having a detrimental affect, so I would like to avoid having more static 
code. Also, I'd really like to reduce these overheads by, at least, an 
order of magnitude.

Cheers,
Sam

On Thursday, June 12, 2025 at 4:02:24 PM UTC+1 Emanuel Ziegler wrote:

> Hi Sam,
>
> In principle, loop unrolling should already reduce the number of stack 
> checks, but it could be that it's insufficient or that for whatever reason 
> this optimization does not get applied here. Did you take a look at the 
> generated code?
>
> Cheers,
>     Emanuel
>
> On Thu, Jun 12, 2025 at 4:44 PM Sam Parker-Haynes <[email protected]> 
> wrote:
>
>> Hi!
>>
>> While running some AI code, the loop header WasmStackCheck was appearing 
>> quite heavily in the profile. Disabling the checks results in ~1.5% 
>> speedup. So, is it necessary to execute these for every iteration? Or could 
>> we wrap inner loops, devoid of a stack check, in a new loop with one so 
>> that these checks are executed for a fraction of what they are now?
>>
>> Cheers,
>> Sam
>>
>>
>>
>> -- 
>> -- 
>> v8-dev mailing list
>> [email protected]
>> http://groups.google.com/group/v8-dev
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "v8-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/v8-dev/b4a77d25-21f9-4a0d-a467-8cbe48275bfbn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/v8-dev/b4a77d25-21f9-4a0d-a467-8cbe48275bfbn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/v8-dev/40bdfecb-a435-4b21-8945-177fd1d82998n%40googlegroups.com.

Reply via email to