We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
-a * (-a * a)
Consider the following two functions. https://godbolt.org/z/Taza3zT3G
int foo(int a) { return -a * (-a * a); } int bar(int a) { return (-a * -a) * a; }
I expect the following output for both functions.
mov eax, edi imul eax, edi imul eax, edi ret
But interestingly, the output of Clang is better than that of GCC for the following function. https://godbolt.org/z/17qvs9xcd
int foo1(int a, int b, int c) { return -a * (-b * c); }
The text was updated successfully, but these errors were encountered:
Alive proof: https://alive2.llvm.org/ce/z/VQZh2L
Sorry, something went wrong.
(-x * y * -x)
(x * y * x)
[InstCombine] Simplifiy (-x * y * -x) into (x * y * x) (#72953)
e6d2bb0
fix #72259 proof: https://alive2.llvm.org/ce/z/HsrmTC
Note GCC only optimizes this at the RTL level and not the gimple level, filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113189 to optimize it at the gimple level too.
4ecef9c
fix llvm/llvm-project#72259 proof: https://alive2.llvm.org/ce/z/HsrmTC
Successfully merging a pull request may close this issue.
Consider the following two functions.
https://godbolt.org/z/Taza3zT3G
I expect the following output for both functions.
mov eax, edi imul eax, edi imul eax, edi ret
But interestingly, the output of Clang is better than that of GCC for the following function.
https://godbolt.org/z/17qvs9xcd
The text was updated successfully, but these errors were encountered: