RFR: 8312440: assert(cast != nullptr) failed: must have added a cast to pin the node

Roland Westrelin roland at openjdk.org
Thu Jul 27 07:27:58 UTC 2023


On Tue, 25 Jul 2023 09:31:46 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> The test has a loop nest with 2 loops. A node is sunk out of the inner
>> loop. A cast is created to pin the node out of loop. The logic added
>> by 8308103 looks for an existing cast with the same inputs. It finds
>> one and uses that one. That existing cast was created before the
>> current round of loop opts. Eventhough it has the right out of inner
>> loop (but in outer loop) control input, it was assigned a control out
>> of both loops (the control is legal, it just happens that no use keeps
>> the cast in the outer loop). Next, the same node is sunk out of the
>> outer loop. The logic for sinking nodes looks for an input in the
>> outer loop (otherwise why would the node be in the outer loop) and
>> find none even though there should be one. The assert fires. The
>> reason is that the cast input has control out of loop. The fix I
>> propose is to not use an existing cast if it doesn't have the expected
>> control.
>
> Looks good to me.

@chhagedorn @vnkozlov @TobiHartmann thanks for the reviews

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

PR Comment: https://git.openjdk.org/jdk/pull/14999#issuecomment-1653047436


More information about the hotspot-compiler-dev mailing list