RFR: 8265938: C2's conditional move optimization does not handle top Phi
Tobias Hartmann
thartmann at openjdk.java.net
Mon Apr 26 08:40:30 UTC 2021
On Mon, 26 Apr 2021 08:21:38 GMT, Hui Shi <hshi at openjdk.org> wrote:
>> Thanks for the review, Christian!
>
> @TobiHartmann Thanks for fixing tencent reported bug! Your fix is good.
>
> Could an early check added after ccp GVN? Check if it is compiling a method currently in inifinite loop and abort compilation earlier?
>
>
> --- a/src/hotspot/share/opto/compile.cpp
> +++ b/src/hotspot/share/opto/compile.cpp
> @@ -2287,6 +2287,9 @@ void Compile::Optimize() {
> TracePhase tp("iterGVN2", &timers[_t_iterGVN2]);
> igvn = ccp;
> igvn.optimize();
> + if (root()->req() == 1) {
> + record_method_not_compilable("trivial infinite loop after phase ccp");
> + }
> }
> print_method(PHASE_ITER_GVN2, 2);
@huishi-hs thanks for the review. This version of the fix was also proposed by the reporter but is not sufficient because it assumes that the infinite loop is reachable from all exit paths. This is not the case in my version of the regression test, were the infinite loop is only in the `b == true` branch.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3684
More information about the hotspot-compiler-dev
mailing list