WebAssembly / design

WebAssembly Design Documents
http://webassembly.org
Apache License 2.0
11.4k stars 693 forks source link

use hot(0xflags,, priority, id, {var,} ) as compiler directive profile #1229

Open AhliLi opened 6 years ago

AhliLi commented 6 years ago

use HOT as compiler directives and profile hints for efficient prioritisation.

flags: first bits should indicate { start/stop directive, linear sequence, iterator loop, parallel, parallel^, thread synch, (calls function), and optimisation profile (standard pattern)} float priority: 1.0f typical, sorted by compiler id: <></>

optional variable / register declarations

Also wise to include numeric scope for higher efficiency processing of fixed bit scope, io profile for gl and audio/video, hints on endpoint optimisation (pixel buffer, audio, webgl, etc.)

titzer commented 6 years ago

I generally like the idea of a hint section. However, I think it makes sense to reduce the granularity of the hints to make simple, clear signals. E.g. one proposal that has been discussed in various offline conversations is a "hint section" to specify per-function hot/cold/startup hints that basically tell an engine which tier to use for which function and whether each function is needed for "fast startup" or not.