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
[x86] convert xor with MIN_SIGNED_VALUE to add #51609
Comments
Can we just add an isel pattern? |
And to X86DAGToDAGISel::matchAddressRecursively as well maybe? |
Although a INT_MIN address offset is pretty rare..... |
Depends if we think there's potential for secondary combines?
That's
or:
|
Before adding X86 specific handling, I've proposed adding generic AddLike support in https://reviews.llvm.org/D122754 |
matchAddressRecursively support - https://reviews.llvm.org/D122815 |
Landed at c64f37f |
[X86] Add XOR(X, MIN_SIGNED_VALUE) -> ADD(X, MIN_SIGNED_VALUE) isel patterns (PR52267) Landed at ffe0cc8 |
Landed at 3369e47 |
Extended Description
Based on discussion in https://reviews.llvm.org/D112085 :
These are logically equivalent:
https://alive2.llvm.org/ce/z/qV46E2
...and instcombine chooses 'xor' for better analysis in IR. But x86 (probably unlike most targets), may benefit from converting it back to 'add' (for legal integer types) because that can be lowered as LEA:
vs.
The text was updated successfully, but these errors were encountered: