RFR: 8273454: C2: Transform (-a)*(-b) into a*b [v4]
Zhengyu Gu
zgu at openjdk.java.net
Thu Sep 16 18:28:20 UTC 2021
On Thu, 16 Sep 2021 07:24:49 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> You can't control the iteration in which the test would fail if there's a bug in C2 (it could only fail for **some** random values). Therefore, you could as well use random values for the warmup and simply increase `TEST_COUNT` to ensure that C2 compilation is triggered and we run a reasonable amount of iterations with C2 compiled code.
>>
>> Your newest version of the test now has the problem that OSR compilation might C2 compile the computation of the expected value and then you are comparing the output of a C2 compiled method to a C2 compiled method instead of the interpreter. You have the following options:
>> - Compute the expected value as `a * b`. In that case it's fine if the computation is C2 compiled as well.
>> - Prevent compilation of the `run*` methods (either by disabling OSR compilation or by completely disabling compilation of these methods)
>
> And sorry for being picky here but I would like to keep tests as simple as possible :)
Fixed according to you comments.
I really appreciate you suggestions, thanks!
-------------
PR: https://git.openjdk.java.net/jdk/pull/5403
More information about the hotspot-compiler-dev
mailing list