Optimize offset_from_unsigned result bounds - #161063
Conversation
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
r? libs |
|
Seems reasonable. For lack of any niche-type APIs that represent this, it should be okay to add this assumption. @bors r+ |
…unsigned-bound, r=clarfonthey Optimize offset_from_unsigned result bounds Hint that result cannot be larger than isize max
…unsigned-bound, r=clarfonthey Optimize offset_from_unsigned result bounds Hint that result cannot be larger than isize max
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #161089 (comment) @bors try jobs=test-various |
|
This pull request was unapproved. This PR was contained in a rollup (#161092), which was unapproved. |
This comment has been minimized.
This comment has been minimized.
…und, r=<try> Optimize offset_from_unsigned result bounds try-job: test-various
|
💔 Test for f4b1164 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
Not sure if spurious, will have to take a closer look later. |
|
@rustbot review |
|
Finally getting back to this, confused why it passed CI in the PR but not on the rollup, but this is indeed a real issue. Running locally I also have a failure for the test that failed, So, @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
cc @scottmcm because this seems like a bad idea for all the usual reasons. |
|
In addition to all the reasons why adding |
|
So, given existing discussion and the breakage, I'm going to close this. Will list the various points separately. First, per the repo's LLM policy we do at minimum require disclosure of LLM usage, and it appears you have submitted a few PRs post this policy being merged without disclosure despite LLM usage. (Evident by the Second, we do want to have a higher bar for approval on changes that just blanket-apply Third, also just going on the second point, we generally prefer that performance improvements are based in benchmarks or other real data that indicates the improvement, not just guesses on invariants. So, rather than finding invariants that the optimizer cannot assume, we want to show cases where that non-assumption is leading to noticeably worse code. So, with that said, I'm closing this for now. |
|
Also see #123598 where I tried doing this previously -- notably inside the intrinsic which I think is better than in the rust code -- but it still was red in perf. (The 64-bit only restriction here made me particularly skeptical, too.) |
Hint that result cannot be larger than isize max