-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
xor-inferring optimizations would be nice #1882
Comments
assigned to @lattner |
Compile this with llvm-gcc: unsigned int *a, *b; void joy(void) { and you get: define void @joy() { it could just use xor? |
Here's a C vector example: typedef unsigned attribute((vector_size(16))) vu; vu test1(vu a, vu b) { vu test2(vu a, vu b) { |
Implemented. There are many patches to this, the primary ones being: Testcase here: Transforms/InstCombine/and-or-not.ll This shrunk Duraid's nasty example from 32K lines of x86-64 .s file to 23k lines. -Chris |
Extended Description
we don't currently infer that
~( ~(a|b) | (a&b) ) -> a^b
and similar, e.g. ~(~a & ~b) & ~(a&b) -> a^b
The text was updated successfully, but these errors were encountered: