RFR: 8323972: C2 compilation fails with assert(!x->as_Loop()->is_loop_nest_inner_loop()) failed: loop was transformed
Christian Hagedorn
chagedorn at openjdk.org
Wed Mar 6 14:52:47 UTC 2024
On Wed, 6 Mar 2024 13:57:53 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> I think it's good practice to set the control of a cast node. It probably doesn't make much of a difference here but we had so many issues with cast nodes that not setting control on cast makes me nervous now.
That is indeed a general problem. The situation certainly got better by removing the code that optimized cast nodes that were pinned at If Projections (https://github.com/openjdk/jdk/commit/7766785098816cfcdae3479540cdc866c1ed18ad). By pinning the casts now, you probably want to prevent the cast nodes to be pushed through nodes such that it floats "too high" and causing unforeseenable data graph folding while control is not?
> The problem with a normal dependency is that initially the cast and its non transformed input have the same types. So, there is a chance the cast is processed by igvn before its input changes and if that happens, the cast would then be removed.
I see, thanks for the explanation. Then it makes sense to keep the cast node not matter what.
> I thought about that too (I didn't go as far as you did though) and my conclusion is that the change I propose should be more robust (what if the improved type computation still misses some cases that we later find are required) and less risky.
I agree, this fix should use casts. Would be interesting to follow this idea in a separate RFE.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17965#discussion_r1514615913
More information about the hotspot-compiler-dev
mailing list