-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Redundant instructions involving indexing with bool
s
#123216
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
Labels
A-codegen
Area: Code generation
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
This seems to be okay on current nightly: f:
test esi, esi
je .LBB0_2
xor dil, dl
or byte ptr [rcx], 1
.LBB0_2:
movzx eax, dil
and eax, 1
shl eax, 4
or byte ptr [rcx + rax], 1
ret |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 27, 2024
…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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 12, 2025
…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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 19, 2025
…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.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Feb 10, 2025
…, 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.
Zalathar
added a commit
to Zalathar/rust
that referenced
this issue
Feb 10, 2025
…, 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.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Feb 10, 2025
…, 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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 11, 2025
…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.
Noratrieb
added a commit
to Noratrieb/rust
that referenced
this issue
Mar 6, 2025
…, 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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 15, 2025
…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.
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-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
It compiles to the following assembly:
The
jmp .LBB0_3
andand dil, 1
instructions are useless, becausedil
is moved toeax
andand
ed with1
there anyway, anddil
is not used anywhere.The output improves if you avoid using
bool
s.godbolt
Meta
rustc --version --verbose
:@rustbot modify labels: -C-bug +C-optimization +A-codegen +A-LLVM +I-slow +I-heavy
The text was updated successfully, but these errors were encountered: