[DAGCombine] Improve ReduceLoadWidth for SRL
authorSam Parker <sam.parker@arm.com>
Wed, 4 Apr 2018 09:26:56 +0000 (09:26 +0000)
committerSam Parker <sam.parker@arm.com>
Wed, 4 Apr 2018 09:26:56 +0000 (09:26 +0000)
commit7ec722d60348ca852aa261c2f1da6fec8020eb50
treed154437d159661e314854613289d842d73089b8c
parent94e148c8304f5a2e6822b09aa44080e74124c40a
[DAGCombine] Improve ReduceLoadWidth for SRL

Recommitting rL321259. Previosuly this caused an issue with PPCBE but
I didn't receieve a reproducer and didn't have the time to follow up.
If the issue appears again, please provide a reproducer so I can fix
it.

Original commit message:

If the SRL node is only used by an AND, we may be able to set the
ExtVT to the width of the mask, making the AND redundant. To support
this, another check has been added in isLegalNarrowLoad which queries
whether the load is valid.

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

llvm-svn: 329160
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/ARM/shift-combine.ll
llvm/test/CodeGen/X86/h-registers-1.ll