Repository navigation
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 6 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
I'm exploring tooling changes against this prototype. |
| } | ||
| metadata[8] = branchHint == WasmBranchHint::LikelyTrue ? 1 : 0; | ||
|
|
||
| JitMetadata::report(m_compiler, JitMetadata::WasmBranchHint, metadata, sizeof(metadata)); |
There was a problem hiding this comment.
We don't want to call report here, it will get called automatically when the jit is done with the method. Instead, increment the metric.
| instrDesc* prevId = nullptr; | ||
| #endif // defined(DEBUG) && defined(TARGET_ARM64) | ||
|
|
||
| #ifdef TARGET_WASM |
There was a problem hiding this comment.
Omit this (see below).
If you want to know what % of branches got hinted it will take more work.
| assert(trueTarget != block->Next()); | ||
|
|
||
| WasmBranchHint branchHint = WasmBranchHint::None; | ||
| bool const hasStaticProfile = |
There was a problem hiding this comment.
I would just call fgHaveProfileWeights here and not worry about the source or quantity.
| WasmBranchHint branchHint = WasmBranchHint::None; | ||
| bool const hasStaticProfile = | ||
| (m_compiler->fgPgoSource == ICorJitInfo::PgoSource::Static) && m_compiler->fgHaveSufficientProfileWeights(); | ||
| if (hasStaticProfile || (JitConfig.JitWasmBranchHintStress() != 0)) |
There was a problem hiding this comment.
Instead of forcing on hints then you could force them off here.
Experimental implementation of #133794: emit the standard WebAssembly
metadata.code.branch_hintcustom section from CoreCLR ReadyToRun when static PGO shows a strongly biased branch. Engines that don't consume branch hints ignore the section.br_ifoffsets through the JIT metadata channel (reset on internal retries).JitWasmBranchHintStressenables deterministic tests with synthesized profiles.The section adds 32 bytes to the test module. Before this can merge it needs end-to-end measurements on engines that consume hints: startup and steady-state time, engine compile time, native code size, and R2R image size.
Note
This pull request description was drafted with GitHub Copilot.