[PATCH] D148809: [DAG][AArch64] Limit preferIncOfAddToSubOfNot until after legalization if the node has wrap flags

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 08:41:52 PDT 2023


dmgreen created this revision.
dmgreen added reviewers: RKSimon, SjoerdMeijer, samtebbs, jaykang10.
Herald added subscribers: ecnelises, hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

If the add node has wrap flags then they will be destroyed by converting to sub/not. The flags can be useful in converting to rhadd, for example, but that can happen late if the node types need to be legalized. This limits the preferIncOfAddToSubOfNot fold until after legalize DAG if the node have flags to allow more folding.


https://reviews.llvm.org/D148809

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/arm64-vhadd.ll
  llvm/test/CodeGen/AArch64/sve-hadd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148809.515347.patch
Type: text/x-patch
Size: 6633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230420/6bae8c1c/attachment.bin>


More information about the llvm-commits mailing list