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

Add codegen test for issue #73827 #78046

Merged
merged 1 commit into from
Oct 20, 2020
Merged

Conversation

bugadani
Copy link
Contributor

Closes #73827

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 17, 2020
if x > 7 || y > 7 {
0
} else {
// CHECK-NOT: panic_bounds_check
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to move this line up and move it below the CHECK-LABEL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to write this as a dismissal, but I personally prefer having them where I expect the instruction to (not) be.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is fine. I just prefer to do whatever https://llvm.org/docs/CommandGuide/FileCheck.html does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess when you have two languages that are close enough, mixing them could seem messy. But with Rust I feel marking the problematic point can have a tiny bit of usefulness :)

@camelid camelid added A-codegen Area: Code generation A-testsuite Area: The testsuite used to check the correctness of rustc labels Oct 17, 2020
@Mark-Simulacrum
Copy link
Member

r? @nikic

I think this is right though negative testing is always a bit concerning (if we were to rename panic_bounds_check it seems like this test would continue to pass, despite being wrong). Have we verified that it fails on older rustc compilers (that didn't have LLVM 11)?

@nikic
Copy link
Contributor

nikic commented Oct 20, 2020

@bors r+ rollup

Yeah, negative testing can fail if the function gets renamed, but generating full positive check lines couples us too tightly to LLVM. We already have plenty of other tests that use CHECK-NOT: panic_bounds_check, so I think it's fine to go with this.

@bors
Copy link
Contributor

bors commented Oct 20, 2020

📌 Commit 64c239c has been approved by nikic

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 20, 2020
This was referenced Oct 20, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 20, 2020
…laumeGomez

Rollup of 9 pull requests

Successful merges:

 - rust-lang#78046 (Add codegen test for issue rust-lang#73827)
 - rust-lang#78061 (Optimize const value interning for ZST types)
 - rust-lang#78070 (we can test std and core panic macros together)
 - rust-lang#78076 (Move orphan module-name/mod.rs files into module-name.rs files)
 - rust-lang#78129 (Wrapping intrinsics doc links update.)
 - rust-lang#78133 (Add some MIR-related regression tests)
 - rust-lang#78144 (Don't update `entries` in `TypedArena` if T does not need drop)
 - rust-lang#78145 (Drop unneeded `mut`)
 - rust-lang#78157 (Remove unused type from librustdoc)

Failed merges:

r? `@ghost`
@bors bors merged commit 2c1de08 into rust-lang:master Oct 20, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 20, 2020
@bugadani bugadani deleted the issue-73827 branch October 21, 2020 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missed optimization to elide bounds check
8 participants