[PATCH] D104765: [DAG] Reassociate Add with Or

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 00:55:44 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: efriedma, RKSimon, craig.topper, spatel.
Herald added subscribers: ecnelises, hiraditya.
dmgreen requested review of this revision.
Herald added a project: LLVM.

We already have reassociation code for Adds and Ors separately in DAG combiner, this adds it for the combination of the two where Ors act like Adds. It reassociates `(add (or (x, c), y) -> (add (add (x, y), c))` where we know that the Ors operands have no common bits set, and the Or has one use.


https://reviews.llvm.org/D104765

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/ARM/add-like-or.ll
  llvm/test/CodeGen/Hexagon/isel-global-offset-alignment.ll
  llvm/test/CodeGen/SystemZ/addr-01.ll
  llvm/test/CodeGen/SystemZ/addr-02.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104765.353862.patch
Type: text/x-patch
Size: 6284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210623/2c2c071e/attachment.bin>


More information about the llvm-commits mailing list