-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Missed optimization: bitwise OR #43481
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
Comments
https://godbolt.org/z/P5-bZ5 Looks like we are missing an undo middle-end canonicalization too? |
Candidate X86 backend patch: https://reviews.llvm.org/D100177 |
X86 Backend support: BMI: rG245036950a7a |
The middle-end reverse fold would require a freeze to be valid: https://alive2.llvm.org/ce/z/PgAUx5 define i1 @src(i8 %a, i8 %b) {
%n = xor i8 %a, -1
%o = and i8 %n, %b
%c = icmp eq i8 %o, 0
ret i1 %c
}
define i1 @tgt(i8 %a, i8 %b) {
%aa = freeze i8 %a
%o = or i8 %aa, %b
%c = icmp eq i8 %o, %aa
ret i1 %c
} |
Candidate middle-end patch: https://reviews.llvm.org/D100211 |
There's some concern about introducing freeze() for this middle-end fold, so this has been abandoned, we can maybe revisit this in the future. Resolving as there's nothing else we're intending to do anytime soon. |
mentioned in issue #49274 |
Extended Description
For the following code:
clang(trunk) with '-O3 -march=haswell' produces:
but GCC(trunk) with '-O3 -march=haswell' produces:
Godbolt playground: https://godbolt.org/z/MZNdWW
The text was updated successfully, but these errors were encountered: