Skip to content

Assert intrinsic implementations are inlined properly #261

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 3, 2018

Conversation

alexcrichton
Copy link
Member

This adds an assertion with the assert_instr macro that intrinsics aren't literally calling one another but rather everything is nice and inlined. This then touches up various intrinsics that accidentally had a call instruction in their implementation.

gnzlbg and others added 3 commits January 3, 2018 13:29
The ABI of types like `u8x8` as they're defined isn't actually the underlying
type we need for LLVM, but only `__m64` currently satisfies that. Apparently
this (and the casts involved) caused some extraneous instructions for a number
of intrinsics. They've all moved over to the `__m64` type now to ensure that
they're what the underlying interface is.
These should be harmless when evaluating whether we failed inlining
@alexcrichton alexcrichton merged commit 4022efe into rust-lang:master Jan 3, 2018
@alexcrichton alexcrichton deleted the more-fixes branch January 3, 2018 22:37
// immediately followed by a `pop` to learn about the current address.
// Let's not take that into account when considering whether a function
// failed inlining something.
let followed_by_pop = function.instrs.get(i + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did you figure this out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I look at the disassembly and recognized the instruction sequence. Additionally compiling with -C relocation-model=static made it go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants