RFR: 8350177: C2 SuperWord: Integer.numberOfLeadingZeros, numberOfTrailingZeros, reverse and bitCount have input types wrongly turncated for byte and short [v2]
Emanuel Peter
epeter at openjdk.org
Tue Jun 10 05:22:28 UTC 2025
On Tue, 10 Jun 2025 04:54:15 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
> My concern is that this might cause unexpected assert failures to occur in rare cases, which could create a large bug tail.
If it is only an assert, and you return the "conservative" answer in product, then it only affects debug. This means we don't have to be too worried about it when the assert fails. And it gives us a chance to look at that new node, and decide if truncation is ok or not. A good comment at the site of the assert would make fixing those assert bugs quite easy. It would be an assert that ensures we get better performance because we vectorize. I think this is easier than having to write IR tests for all possible nodes with all possible truncations, that would be the alternative I suppose. But with IR tests we might always miss an operation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25440#discussion_r2136931199
More information about the hotspot-compiler-dev
mailing list