[PATCH] D112377: [DAGCombiner] make matching bit-hack form of usubsat more flexible
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 24 05:19:41 PDT 2021
spatel created this revision.
spatel added reviewers: foad, RKSimon, craig.topper.
Herald added subscribers: ecnelises, kerbowa, steven.zhang, pengfei, hiraditya, nhaehnle, jvesely, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.
(i8 X ^ 128) & (i8 X s>> 7) --> usubsat X, 128
As suggested in D112085 <https://reviews.llvm.org/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 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.
https://reviews.llvm.org/D112377
Files:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/usubsat.ll
llvm/test/CodeGen/X86/psubus.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112377.381777.patch
Type: text/x-patch
Size: 9692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211024/2f715087/attachment.bin>
More information about the llvm-commits
mailing list