Value type sorting

John Rose john.r.rose at oracle.com
Mon Aug 27 17:29:00 UTC 2018


On Aug 27, 2018, at 7:54 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
> 
> So the performance difference comes from a limitation of C2 unrelated to value types. I'll have a
> look if we can optimize that or file an RFE.

So this doesn't fold up:  ((a < b) ? -1 : (a == b) ? 0 : 1) > 0.
I suspect it *would* fold up (via split-if?) if by pure chance
the expression were (a > b) ? 1 : (…  something <= 0 …).

This variation ((a < b) ? -1 : (a == b) ? 0 : 1) < 0  probably
*does* fold up.

C2 doesn't handle trichotomy calculations as well as it should.
There is no TypeInt::CC_NE, for example.  And these trivial
but nested ?:?: expressions are not inspected vigorously
enough.  They should be.  I don't think we can do anything
about CC_NE, though.  But maybe we can transform (?:?:)
cmp x by reordering the (?:?:) so the top-level ?: shows
sides that appear on either side of x.

My $0.02.
— John




More information about the valhalla-dev mailing list