]> granicus.if.org Git - llvm/commit
[ARM] Combine ands+lsls to lsls+lsrs for Thumb1.
authorEli Friedman <efriedma@codeaurora.org>
Tue, 22 Jan 2019 01:51:37 +0000 (01:51 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Tue, 22 Jan 2019 01:51:37 +0000 (01:51 +0000)
commit6788e26abe048cbc6fb06a0934e824a6d455cdbc
tree800a7b356251c828524fc2c348a7e3d53f23a90c
parent27ae9060d2d08a45465001eadef4a131b2928d04
[ARM] Combine ands+lsls to lsls+lsrs for Thumb1.

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 comes out of 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.

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 DAGCombine
here.

Differential Revision: https://reviews.llvm.org/D56032

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351776 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/Thumb/shift-and.ll