[ARM][ParallelDSP] Enable multiple uses of loads
authorSam Parker <sam.parker@arm.com>
Thu, 14 Mar 2019 11:14:13 +0000 (11:14 +0000)
committerSam Parker <sam.parker@arm.com>
Thu, 14 Mar 2019 11:14:13 +0000 (11:14 +0000)
commit4c4ff13d3c813712a80e030ae0a38ca475df74d9
tree708816a5605cf964194e8861925bcea4ca648128
parenteb0b8019e8927ec82050aa8689a121d5c0ea69c8
[ARM][ParallelDSP] Enable multiple uses of loads

When choosing whether a pair of loads can be combined into a single
wide load, we check that the load only has a sext user and that sext
also only has one user. But this can prevent the transformation in
the cases when parallel macs use the same loaded data multiple times.

To enable this, we need to fix up any other uses after creating the
wide load: generating a trunc and a shift + trunc pair to recreate
the narrow values. We also need to keep a record of which loads have
already been widened.

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

llvm-svn: 356132
llvm/lib/Target/ARM/ARMParallelDSP.cpp
llvm/test/CodeGen/ARM/ParallelDSP/multi-use-loads.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/ParallelDSP/smlad0.ll
llvm/test/CodeGen/ARM/ParallelDSP/unroll-n-jam-smlad.ll [new file with mode: 0644]