Open Kmeakin opened 2 months ago
cc @DianQK
Could you explain further what transformation you're looking here?
Ah, thanks! So...
I think this is a backend problem. In these cases, x86_64 either generates the same instructions or the tgt*
are even worse: https://godbolt.org/z/aKjWjzKjG.
Perhaps there should be a general matching pattern that recognizes them as the same instruction sequence, allowing different architectures to select the optimal instruction sequence.
@llvm/issue-subscribers-backend-aarch64
Author: Karl Meakin (Kmeakin)
@llvm/issue-subscribers-backend-x86
Author: Karl Meakin (Kmeakin)
InstCombine should recognize code of the form
x == SMIN ? default : -x
and canonicalize it to usellvm.ssub.with.overflow(0, x)
https://godbolt.org/z/MqfvKh74G