RFR: 8284742: x86: Handle integral division overflow during parsing [v2]

Quan Anh Mai duke at openjdk.java.net
Thu Apr 14 02:37:14 UTC 2022


On Wed, 13 Apr 2022 18:37:51 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   move div_fixup to share code
>
> 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.

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

PR: https://git.openjdk.java.net/jdk/pull/8206


More information about the hotspot-compiler-dev mailing list