-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add Three Codegen Tests #134626
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
base: master
Are you sure you want to change the base?
Add Three Codegen Tests #134626
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
29a1d0f
to
83038e0
Compare
This comment has been minimized.
This comment has been minimized.
83038e0
to
ddb52ce
Compare
This comment has been minimized.
This comment has been minimized.
ddb52ce
to
62fedef
Compare
@bors r+ rollup=iffy |
…r=Mark-Simulacrum Add Four Codegen Tests Closes rust-lang#74615 Closes rust-lang#123216 Closes rust-lang#49572 Closes rust-lang#93514 This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
62fedef
to
0ec717b
Compare
@bors r+ |
…r=Mark-Simulacrum Add Four Codegen Tests Closes rust-lang#74615 Closes rust-lang#123216 Closes rust-lang#49572 Closes rust-lang#93514 This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@rustbot author |
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.
This PR adds four codegen tests. The FileCheck assertions were generated with the help of
update_test_checks.py
andupdate_llc_test_checks.py
from the LLVM project.
Should we use them? Or should we add so many CHECK
?
Unlike LLVM, we test multiple platforms in Rust, and this IR also comes from codegen. These IRs can vary.
// CHECK: andl $1, %eax | ||
// CHECK: shll $4, %eax | ||
// CHECK: orb $1, (%rcx,%rax) | ||
// CHECK-NOT: jmp |
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.
Just a question: should this be an assembly test?
The IR change was introduced by llvm/llvm-project#84628, and this is not a backend change.
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.
Yeah, I think assembly test would be better because there isn't a big difference in the IR: https://rust.godbolt.org/z/sd7G1rsa7
Thanks
…, r=Mark-Simulacrum Add Four Codegen Tests Closes rust-lang#74615 Closes rust-lang#123216 Closes rust-lang#49572 Closes rust-lang#93514 This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
@veera-sivarajan any updates on this? thanks |
Yeah, I realized we don't need such stringent checks. Thanks for letting me know. |
dfca140
to
8c80d2e
Compare
Removed a test since it regressed in nightly: https://godbolt.org/z/G3989xP1G |
@rustbot review |
@bors r+ |
…r=Mark-Simulacrum Add Three Codegen Tests Closes rust-lang#123216 Closes rust-lang#49572 Closes rust-lang#93514 This PR adds three codegen tests.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@rustbot author |
let mut a = a & 1 != 0; | ||
if b { | ||
a ^= c; | ||
d[0] |= 1; | ||
} | ||
d[a as usize] |= 1; |
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.
This is a bunch of kinda-random unjustified code. What's special about it? What makes it worth us having a test for it? Can we focus it way more somehow?
I ask because this is the kind of test that tends to rot -- people look at it, there's one assembly instruction different, go "eh, probably fine" and just update the CHECK
s, quickly leading to it not really testing anything that matters any more.
What changed? Where was it fixed? Can we add a more specific test somehow?
If we don't already have a test for "we can eliminate the bounds check for indexing with bool into a [T; 2]
" that sounds like a good test. But this particular combination with xors and such? I'm just not convinced.
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.
Especially since, as you can see by the failure in bors, doing this in assembly coupled it to the calling convention, so it can't pass on both linux and windows with hard-coded register names like this.
Closes #123216
Closes #49572
Closes #93514
This PR adds three codegen tests.