RFR: 8349523: Unused runtime calls to drem/frem should be removed

Tobias Hartmann thartmann at openjdk.org
Fri Feb 21 14:30:52 UTC 2025


On Fri, 21 Feb 2025 14:05:10 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> I agree that if we had a notion of pure function (and then, without memory output and such), we could make it more general. It surely would be nice, but it feels out of scope. If such a node gets introduced, it would be pretty easy to refactor.
>
>> It surely would be nice, but it feels out of scope.
> 
> I strongly disagree with this sentiment. This patch fixes one particular issue (dead code elimination) with 1 particular kind of operation (floating-point remainder, which is IMO a really niche operation). This patch does not fix other issues (GVN, scheduling, floating-point remainder alters memory unnecessarily, etc) or does not fix the issue with other similar operations. I don't think the benefits justify adding this band-aid.

@merykitty For context, while this is certainly an edge case, the issue was originally reported by a customer via [JDK-8349364](https://bugs.openjdk.org/browse/JDK-8349364). This patch is essentially a follow-up to [JDK-8345766](https://bugs.openjdk.org/browse/JDK-8345766), which was incomplete in that it did not remove unused operations.

I think we all agree that a more general solution would be ideal, but given its complexity, addressing this specific issue first seems like a reasonable approach. Also, @marc-chevalier is new to the team - let's make sure we don’t overwhelm him! :)

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

PR Comment: https://git.openjdk.org/jdk/pull/23694#issuecomment-2674697794


More information about the hotspot-compiler-dev mailing list