diff options
author | Sanjay Patel <spatel@rotateright.com> | 2021-10-25 08:57:10 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2021-10-25 09:01:52 -0400 |
commit | 6e46b66e2aa7ccfc65d26d1a640e0365a2bdae02 (patch) | |
tree | ad4b93a0ad0622a0610eee8d5685b2a91804b07f /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | f9089accbac128213542703256e65ec64cba17d1 (diff) | |
download | llvm-6e46b66e2aa7ccfc65d26d1a640e0365a2bdae02.zip llvm-6e46b66e2aa7ccfc65d26d1a640e0365a2bdae02.tar.gz llvm-6e46b66e2aa7ccfc65d26d1a640e0365a2bdae02.tar.bz2 |
[DAGCombiner] make matching bit-hack form of usubsat more flexible
(i8 X ^ 128) & (i8 X s>> 7) --> usubsat X, 128
As suggested in D112085, we can substitute 'xor' with 'add'
in this pattern, and it is logically equivalent:
https://alive2.llvm.org/ce/z/eJtWWC
We canonicalize to 'xor' in IR, but SDAG does not do that
(and it probably should not - https://llvm.org/PR52267 ), so
it is possible to see either pattern in codegen. Note that
'sub' is a another potential pattern, but that is
canonicalized to 'add' in DAGCombiner, so we don't need to
worry about that variation.
Differential Revision: https://reviews.llvm.org/D112377
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions