You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[libraries-pgo]: Assertion failed 'fgDominate(head, entry)' in 'System.Text.Encoding:GetByteCount(System.String,int,int):int:this' during 'Hoist loop code' (IL size 109; hash 0x10278d31; Tier1) #70802
We decide to clone this fairly complex loop because
Loop L00 has invariant type test [000577] on V17 ... passed profile screening
However, we don't get this right, and after cloning there is now a path from cloning conditions to the slow loop (on the left) over to the fast loop. The edge from BB71->BB72 is problematic; it looks like we didn't clone this subgroup of blocks but instead shared it.
Because of this the fast loop entry BB37 is not dominated by its header BB17, hence the assert.
Hmm, seems fairly clear where things go off the rails.
L00: couldn't find init/test/incr; not LPFLG_ITER loop
Recorded loop L00, from BB15 to BB40 (Head=BB14, Entry=BB34, Exit=BB40)
At left is a simplified linear view, where it is a bit easier to see what's going wrong. We see a middle-entry BB34, top BB15, bottom BB40.
So L00 has some non-loop backedges incident on its entry, and we don't canonicalize that case (we only canonicalize for top).
If we did, we'd produce something like the graph at right, where BB34_A is the block added by canonicalizing BB34 to hoist out the non-loop backedges. Then we could safely clone.
Activity
JIT: rework optCanonicalizeLoop (#70792)
JIT: break loop canonicalization into two stages
JIT: break loop canonicalization into two stages (#70809)
jakobbotsch commentedon Jun 18, 2022
Still seeing this assert in the latest libraries-pgo run.
Pipeline run: https://dev.azure.com/dnceng/public/_build/results?buildId=1832440&view=results
Helix job name: net7.0-Linux-Release-arm64-CoreCLR_checked-fullpgo_random_edge
Work item: System.Text.Encoding.Tests
Console log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-d09ca73c69e646cfbe/System.Text.Encoding.Tests/1/console.ef9d5662.log?helixlogtype=result
AndyAyersMS commentedon Jun 18, 2022
Hmm, ok. Will investigate.
AndyAyersMS commentedon Jun 19, 2022
We decide to clone this fairly complex loop because
However, we don't get this right, and after cloning there is now a path from cloning conditions to the slow loop (on the left) over to the fast loop. The edge from BB71->BB72 is problematic; it looks like we didn't clone this subgroup of blocks but instead shared it.
Because of this the fast loop entry BB37 is not dominated by its header BB17, hence the assert.
AndyAyersMS commentedon Jun 19, 2022
At left is a simplified linear view, where it is a bit easier to see what's going wrong. We see a middle-entry BB34, top BB15, bottom BB40.
So L00 has some non-loop backedges incident on its entry, and we don't canonicalize that case (we only canonicalize for top).
If we did, we'd produce something like the graph at right, where BB34_A is the block added by canonicalizing BB34 to hoist out the non-loop backedges. Then we could safely clone.
JIT: avoid cloning mid-entry loops with multiple non-loop entry preds
JIT: avoid cloning mid-entry loops with multiple non-loop entry preds (…
Sfh fix tests (#8)