RFR: 8345287: C2: live in computation is broken

Dean Long dlong at openjdk.org
Thu Dec 5 01:32: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.

Marked as reviewed by dlong (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/22473#pullrequestreview-2480237284


More information about the hotspot-compiler-dev mailing list