-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Missed optimization of uaddo(x, x) #57330
Comments
@llvm/issue-subscribers-backend-x86 |
@rotateright Do you think we'd be better off handling this in InstCombine? https://alive2.llvm.org/ce/z/ZHhUPZ suggests we don't match the general pattern either |
This pattern is matched on IR level but only in CodeGenPrepare (so after opt -O3). I have no idea why. https://alive2.llvm.org/ce/z/3z32e3 |
The choice to not canonicalize to the intrinsics in IR (move the transform to CGP) was made with: Even in CGP, we've made several adjustments since then to get/avoid different asm for various targets. It's possible that we've progressed enough in analysis that the decision can be revisited, but it requires looking at the output for several different patterns on multiple targets to make sure nothing regresses. |
Filed a beginner bug -- #57338 -- to reduce the icmp: |
This example (even if it seems unlikely in practice) also demonstrates the difficulty of reconciling IR and codegen on patterns like this: |
https://godbolt.org/z/PsGoGGWj8
The
uaddo
is not created for the case ofx + x
. This would save us singlecmp
instruction. This may be because thex + x
is optimized tox << 1
.Discovered while analyzing #57316.
The text was updated successfully, but these errors were encountered: