-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Added codegen tests for different forms of Option::or
#150564
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
Conversation
|
|
|
rustbot has assigned @Mark-Simulacrum. Use |
1612a70 to
80acf74
Compare
|
r? scottmcm |
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.
Thanks for picking up this work!
Looking mostly good; I left some comments. The DAG one I do feel reasonably strongly about. The others think about and feel free to push back if you think otherwise.
|
Reminder, once the PR becomes ready for a review, use |
…8` and `[u8; 1]` cases Co-authored-by: scottmcm <[email protected]>
…t tests with `NonZero<u8>` input
Thank you very much for the valuable feedback - I agree with all the comments, and have attempted to address and implement all of it. I have two further questions:
Thanks again! |
|
@rustbot ready |
|
| pub fn or_match_nz_u8(opta: Option<NonZero<u8>>, optb: Option<NonZero<u8>>) -> Option<NonZero<u8>> { | ||
| // CHECK: start: | ||
| // CHECK-NEXT: [[NOT_A:%.*]] = icmp eq i8 %0, 0 | ||
| // CHECK-NEXT: select i1 [[NOT_A]], i8 %optb, i8 %0 | ||
| // ret i8 |
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.
Thanks for adding these! Nice to see the argument names and such too, since it's short so that's not a big deal.
But that ret on its own isn't actually checking anything. How about, instead,
| pub fn or_match_nz_u8(opta: Option<NonZero<u8>>, optb: Option<NonZero<u8>>) -> Option<NonZero<u8>> { | |
| // CHECK: start: | |
| // CHECK-NEXT: [[NOT_A:%.*]] = icmp eq i8 %0, 0 | |
| // CHECK-NEXT: select i1 [[NOT_A]], i8 %optb, i8 %0 | |
| // ret i8 | |
| pub fn or_match_nz_u8(opta: Option<NonZero<u8>>, optb: Option<NonZero<u8>>) -> Option<NonZero<u8>> { | |
| // CHECK: start: | |
| // CHECK: [[NOT_A:%.+]] = icmp eq i8 %0, 0 | |
| // CHECK: [[R:%.+]] = select i1 [[NOT_A]], i8 %optb, i8 %0 | |
| // CHECK: ret i8 [[R]] |
Since naming the values means that we're not concerned about other things showing up in the middle, and thus don't need to use the -NEXT that the ones looking at just the instructions do.
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.
(And of course ditto the others below)
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.
Another round of suggestions 🙃
The most important one is about the un-CHECKed ret comments, but ponder the others as well.
Thanks for making the previous updates! Hopefully these are the last things I'll think of.
…ormation in `CHECK-` directives Co-authored-by: scottmcm <[email protected]>
…ith directive contents
|
@rustbot ready Thank you very much again for feedback (and patience!). I've implemented all the suggestions (specifically ensuring all |
|
Thanks, this looks great! Welcome to the never-as-simple-as-you'd-wish world of codegen tests :P @bors r+ rollup=iffy (new codegen tests are always a different-target risk) |
…tmcm Added codegen tests for different forms of `Option::or` Adds tests to check the output of the different ways of writing `Option::or` Fixes #124533
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test failed - checks-actions |
|
@bors retry (no way that adding one codegen test broke a ui test) |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 7ecabfa (parent) -> f57b9e6 (this PR) Test differencesShow 4 test diffsStage 1
Stage 2
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard f57b9e6f565a1847e83a63f3e90faa3870536c1f --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (f57b9e6): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.226s -> 474.455s (-0.16%) |
Adds tests to check the output of the different ways of writing
Option::orFixes #124533