[PATCH] D56032: [ARM] Combine ands+lsls to lsls+lsrs for Thumb1.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 21 15:09:58 PST 2018


efriedma created this revision.
efriedma added reviewers: t.p.northover, dmgreen.
Herald added subscribers: kristof.beyls, javed.absar.

This patch may seem familiar... but my previous patch handled the equivalent lsls+and, not this case.  Usually instcombine puts the "and" after the shift, so this case doesn't come up. However, if the shift is generated by lowering a GEP, it won't get canonicalized by instcombine, and DAGCombine doesn't have an equivalent transform.

This also modifies isDesirableToCommuteWithShift to suppress DAGCombine transforms which would make the overall code worse after this transform.

I'm not really happy adding a bunch of code to handle this, but it would probably be tricky to substantially improve the behavior of the target-independent DAGCombine here.


Repository:
  rL LLVM

https://reviews.llvm.org/D56032

Files:
  lib/Target/ARM/ARMISelLowering.cpp
  test/CodeGen/Thumb/shift-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56032.179369.patch
Type: text/x-patch
Size: 6219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181221/922b6017/attachment.bin>


More information about the llvm-commits mailing list