Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use concrete types in glue functions
We used to have concrete types in glue functions, but the way we used to implement that broke inlining of those functions. To fix that, we converted all glue to just take an i8* and always casted to that type. The problem with the old implementation was that we made a wrong assumption about the glue functions, taking it for granted that they always take an i8*, because that's the function type expected by the TyDesc fields. Therefore, we always ended up with some kind of cast. But actually, we can initially have the glue with concrete types and only cast the functions to the generic type once we actually emit the TyDesc data. That means that for glue calls that can be statically resolved, we don't need any casts, unless the glue uses a simplified type. In that case we cast the argument. And for glue calls that are resolved at runtime, we cast the argument to i8*, because that's what the glue function in the TyDesc expects. Since most of out glue calls are static, this saves a lot of bitcasts. The size of the unoptimized librustc.ll goes down by 240k lines.
- Loading branch information
e56b369
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.
saw approval from huonw
at dotdash@e56b369
e56b369
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.
merging dotdash/rust/glue = e56b369 into auto
e56b369
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.
dotdash/rust/glue = e56b369 merged ok, testing candidate = 66e2857
e56b369
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.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/403
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/405
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt/builds/408
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt-vg/builds/401
success: http://buildbot.rust-lang.org/builders/auto-mac-all-opt/builds/405
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/423
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt/builds/426
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/423
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt/builds/427
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt-vg/builds/430
success: http://buildbot.rust-lang.org/builders/auto-linux-all-opt/builds/423
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/407
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt/builds/423
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/202
e56b369
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.
fast-forwarding master to auto = 66e2857