RFR: 8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes [v8]
Quan Anh Mai
qamai at openjdk.org
Thu Nov 28 16:37:22 UTC 2024
On Thu, 28 Nov 2024 16:23:59 GMT, theoweidmannoracle <duke at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/c2/irTests/UDivINodeIdealizationTests.java line 129:
>>
>>> 127: IRNode.DIV_BY_ZERO_TRAP, "1"
>>> 128: })
>>> 129: // Hotspot should keep the division because it may cause a division by zero trap
>>
>> This comment is actually incorrect, the division is kept because the transformation is wrong.
>
> Which part of the transformation do you think is wrong? Do you think there might also be overflow issues and that's why it cannot be replaced with x?
>
> (I took over this comment and test from the pre-existing test for the signed version: test/hotspot/jtreg/compiler/c2/irTests/DivINodeIdealizationTests.java.)
Yupp it can overflow, if it does not then we can totally do this transformation. I think you should remove this line from the newly added test, feel free to also remove it from the old one.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1862472357
More information about the hotspot-compiler-dev
mailing list