RFR: 8284742: x86: Handle integral division overflow during parsing [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Thu Apr 14 03:19:10 UTC 2022
On Thu, 14 Apr 2022 02:34:19 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:
>> I don't like that IR generation is placed in x86 platform specific code. Other platforms could also benefit from such IR (I checked, I'm only not sure about aarch64).
>>
>> I suggest to do it in parse2.cpp by call a new method `parse_div_mod()` also defined in this file. the method will have platform specific `Matcher::check_div_overflow()` (or something) to generate this special IR.
>
> @vnkozlov I agree that this situation is common enough so I moved the logic to construct the branches to share code. I kept `Matcher::parse_one_bytecode` however since it would be helpful for other operations such as masking of shift nodes or handling of out-of-bounds floating-point-to-integer conversions.
>
> @jatin-bhateja The div nodes themselves are constructed with control input, it is the `Ideal` method that may remove this input. Post parse transformation does not only need to replace the div node with the control structure, but also has to restructure the control flow itself, so I think it would be much more complex to do so.
>
> Thank you very much.
Thanks, @merykitty
This is better. I am still not comfortable about passing `Parse` phase pointer to `Matcher` phase (they should not have such relation). May be create `Parse` specific file for platform.
I would like other platforms experts to review these changes and propose corresponding changes for their platforms.
@TheRealMDoerr, @RealLucy and @reinrich, please, review these changes. It looks like these platforms may benefit from this optimization too.
Expert from ARM, @nick-arm, and RISC-V, @RealFYang, please, look too.
Thanks!
-------------
PR: https://git.openjdk.java.net/jdk/pull/8206
More information about the hotspot-compiler-dev
mailing list