- Notifications
You must be signed in to change notification settings - Fork396
Opt: Recognize non-nullabe RT long as subtype of LongType#5189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Discovered while working onscala-js#5077. This allows to remove unnecessaryunboxes and unlocks more inlining.
Full diff on the test suite:https://gist.github.com/gzm0/b6b7b064f0edadbd1b65af827957d9c9 (fast opt). |
@sjrd, a somewhat related question: With nullability in the IR typesystem, why are non-nullable boxed types not subtypes / equivalent to primitive types? |
It seems, this appears quite often in the diff: - var t$1 = $uJ(new $c_RTLong(lo$3, hi$4));- var lo$4 = t$1.RTLong__f_lo;- var hi$5 = t$1.RTLong__f_hi; That not only removes an unnecessary unbox but also an unnecessary allocation. |
They may have a different representation. A non-nullable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice!
That diff is both satisfying, and scary that we were previously leaving such allocations on the table.
289a5e1
intoscala-js:mainUh oh!
There was an error while loading.Please reload this page.
Discovered while working on#5077. This allows to remove unnecessary unboxes and unlocks more inlining.