Skip to content
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

Emit LLVM range metadata for call instructions #50157

Closed
hanna-kruppe opened this issue Apr 22, 2018 · 2 comments
Closed

Emit LLVM range metadata for call instructions #50157

hanna-kruppe opened this issue Apr 22, 2018 · 2 comments
Assignees

Comments

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Apr 22, 2018

Adding !range to a call instruction to communicate the possible range of the return value (analogous to !range on loads) already works in LLVM today, we just need to use it. Fixes the test case in #49572 and we already have the information anyway, so it's a cheap and easy win. cc @eddyb

@nox
Copy link
Contributor

nox commented Apr 22, 2018

I'll try to implement that.

@nox nox self-assigned this Apr 22, 2018
@hanna-kruppe
Copy link
Contributor Author

@nox noticed that this can't actually help with NonZeroU32::get (#49572) because the return type there is plain old u32 🤦‍♂️ But it still helps functions that return fieldless enums, or more generally enums that get packed into a single scalar (but not scalar pairs).

bors added a commit that referenced this issue Apr 24, 2018
Emit range metadata on calls returning scalars (fixes #50157)
bors added a commit that referenced this issue Apr 28, 2018
Emit range metadata on calls returning scalars (fixes #50157)
@bors bors closed this as completed in 9065644 Apr 28, 2018
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

No branches or pull requests

2 participants