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

EncodeUtf8::as_slice results in suboptimal code #36368

Closed
nagisa opened this issue Sep 9, 2016 · 3 comments
Closed

EncodeUtf8::as_slice results in suboptimal code #36368

nagisa opened this issue Sep 9, 2016 · 3 comments

Comments

@nagisa
Copy link
Member

nagisa commented Sep 9, 2016

// We know for sure this method cannot slice out-of-bounds because:
// * 0 ≤ self.pos ≤ 3
// * self.buf.len() = 4
//
// This way the slicing will always succeed, but LLVM is incapable of figuring out both
// these conditions hold, resulting in suboptimal code, especially after inlining,
// containing bound checks and unwinding support code.

@durka
Copy link
Contributor

durka commented Sep 9, 2016

Where are these comments from? Anyway, sounds like a case for the new panic-safe slicing stuff (#36340).

@nagisa
Copy link
Member Author

nagisa commented Sep 9, 2016

Here

@nagisa
Copy link
Member Author

nagisa commented Mar 12, 2017

Not applicable anymore, as a different approach is now used.

@nagisa nagisa closed this as completed Mar 12, 2017
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