RFR: 8345287: C2: live in computation is broken
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Mon Dec 2 09:29:37 UTC 2024
On Mon, 2 Dec 2024 09:03:50 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> 8234003 (Improve IndexSet iteration) broke live in computation:
>
>
> @@ -273,23 +276,25 @@ void PhaseLive::add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ) {
> // Add a vector of live-in values to a given blocks live-in set.
> void PhaseLive::add_livein(Block *p, IndexSet *lo) {
> IndexSet *livein = &_livein[p->_pre_order-1];
> - IndexSetIterator elements(lo);
> - uint r;
> - while ((r = elements.next()) != 0) {
> - livein->insert(r); // Then add to live-in set
> + if (!livein->is_empty()) {
> + IndexSetIterator elements(lo);
> + uint r;
> + while ((r = elements.next()) != 0) {
> + livein->insert(r); // Then add to live-in set
> + }
> }
> }
>
>
> `livein` is initially empy and the patch above only adds element to it if:
>
>
> if (!livein->is_empty()) {
>
>
> which is never true.
>
> This doesn't affect correctness as live in sets are only used to drive
> scheduling.
Good catch! Do you have an example where the final schedule is affected by this issue?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22473#issuecomment-2510998547
More information about the hotspot-compiler-dev
mailing list