RFR: 8342975: C2: Micro-optimize PhaseIdealLoop::Dominators()
Aleksey Shipilev
shade at openjdk.org
Thu Oct 24 18:12:16 UTC 2024
Noticed this while looking at Leyden profiles. C2 seems to spend considerable time doing in this loop. The disassembly shows this loop is fairly hot. Replacing the initialization with memset, while touching more memory, is apparently faster. memset is also what we normally do around C2 for arena-allocated data. We seem to touch a lot of these structs later on, so pulling them to cache with memset is likely "free".
It also looks like current initialization misses initializing the last element (at `C->unique()+1`).
I'll put performance data in separate comment.
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.org/jdk/pull/21690/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21690&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8342975
Stats: 5 lines in 1 file changed: 1 ins; 1 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/21690.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21690/head:pull/21690
PR: https://git.openjdk.org/jdk/pull/21690
More information about the hotspot-compiler-dev
mailing list