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 < 0)
Consider the following functions:
int foo(int a) { return !a == (a > 0); } int bar(int a) { return (a < 0); } int baz(int a) { return !a == (a < 0); } int qux(int a) { return (a > 0); }
Both Clang and GCC can optimize foo to bar. GCC can also optimize baz to qux, but Clang cannot. https://godbolt.org/z/exvTE8Gn7 https://alive2.llvm.org/ce/z/LGvASc
foo
bar
baz
qux
The text was updated successfully, but these errors were encountered:
The fold zext(icmp (A, xxx)) == shr(A, BW - 1) => not(trunc(xor(zext(icmp), shl))) would be a more convenient way to optimize it. alive-tv
zext(icmp (A, xxx)) == shr(A, BW - 1)
not(trunc(xor(zext(icmp), shl)))
Sorry, something went wrong.
[InstCombine] Fold Ext(i1) Pred shr(A, BW - 1) => i1 Pred A s< 0 (#68244
b22917e
) Resolves #67916 . This patch folds `Ext(icmp (A, xxx)) Pred shr(A, BW - 1)` into `i1 Pred A s< 0`. [Alive2](https://alive2.llvm.org/ce/z/k53Xwa).
XChy
Successfully merging a pull request may close this issue.
Consider the following functions:
Both Clang and GCC can optimize
foo
tobar
. GCC can also optimizebaz
toqux
, but Clang cannot.https://godbolt.org/z/exvTE8Gn7
https://alive2.llvm.org/ce/z/LGvASc
The text was updated successfully, but these errors were encountered: