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

Make codegen tests compatible with extra inlining #78967

Merged
merged 3 commits into from
Nov 17, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Nov 12, 2020

No description provided.

The memory allocation in vec might panic in the case of capacity
overflow. Move the allocation outside the function to fix the test.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 12, 2020
Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

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

It's not clear to me why we should be modifying tests without any corresponding compiler changes, but it does look like issue-37945.rs is problematic...

// CHECK-NOT: icmp eq float* {{.*}}, null
// CHECK-LABEL: @is_empty_1(
// CHECK-NEXT: start:
// CHECK-NEXT: [[A:%.*]] = icmp ne i32* %xs.1, null
Copy link
Member

Choose a reason for hiding this comment

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

Check that LLVM understands that Iter pointer is not null.

If we have icmp ne ..., null, it seems like we're failing the thing we meant to test, no?

I don't think we should try to compare exactly what LLVM IR comes out, but perhaps something like:

/// CHECK-NOT: icmp {{.*}}, null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we have icmp ne ..., null, it seems like we're failing the thing we meant to test, no?

It was fixed upstream by canonicalizing to assume.

Copy link
Member

Choose a reason for hiding this comment

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

By "it was fixed upstream", do you mean that will be in LLVM 12? Is there something we could cherry-pick?

My point is the test meant to check that LLVM knows it's not null, so we had a CHECK-NOT: icmp eq ..., null to that effect. Your change reveals that while we were passing that test, we're getting icmp ne ..., null instead, which seems just as bad. So it seems like a real bug with or without your change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fact that pointer is not-null is expressed through llvm.assume that follows, see next check.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, ok, I see what you mean...

@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 16, 2020

It's not clear to me why we should be modifying tests without any corresponding compiler changes

From my perspective those are bugs in tests. Fixes are mostly for my own convenience to be able to run tests with extra inlining. If you don't want to land some / any of those that seems fair.

@cuviper
Copy link
Member

cuviper commented Nov 16, 2020

OK, if CI is happy, I'm happy.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 16, 2020

📌 Commit d54ea4f has been approved by cuviper

@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 Nov 16, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 17, 2020
Make codegen tests compatible with extra inlining
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 17, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#77939 (Ensure that the source code display is working with DOS backline)
 - rust-lang#78138 (Upgrade dlmalloc to version 0.2)
 - rust-lang#78967 (Make codegen tests compatible with extra inlining)
 - rust-lang#79027 (Limit storage duration of inlined always live locals)
 - rust-lang#79077 (document that __rust_alloc is also magic to our LLVM fork)
 - rust-lang#79088 (clarify `span_label` documentation)
 - rust-lang#79097 (Code block invalid html tag lint)
 - rust-lang#79105 (std: Fix test `symlink_hard_link` on Windows)
 - rust-lang#79107 (build-manifest: strip newline from rustc version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f960f28 into rust-lang:master Nov 17, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 17, 2020
@tmiasko tmiasko deleted the codegen-tests branch November 17, 2020 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants