This is an archive of the discontinued LLVM Phabricator instance.

[ARM][ParallelDSP] Enable multiple uses of loads
ClosedPublic

Authored by samparker on Mar 11 2019, 9:14 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker created this revision.Mar 11 2019, 9:14 AM

Mainly nits, one question about the tests.

lib/Target/ARM/ARMParallelDSP.cpp
121 ↗(On Diff #190103)

nit: now that you've changed MemInstList, perhaps you can use that here.

307 ↗(On Diff #190103)

bikeshedding names: not sure if 'profitable' is the right word here. I.e., we're just checking some properties of a load instruction here, and don't do e.g. some cost modeling which I associate with 'profitable'. But I will leave this entirely up to you.

310 ↗(On Diff #190103)

nit: I don't know what exactly the coding style dictates here, but I wouldn't mind if the break was on the same line as the default clause.

test/CodeGen/ARM/ParallelDSP/remove-duplicate-loads.ll
1 ↗(On Diff #190103)

Was wondering if was confusing to have both OPT and LLC tests in one file, also there appears to be only 1 LLC test?

samparker marked an inline comment as done.Mar 12 2019, 8:55 AM
samparker added inline comments.
test/CodeGen/ARM/ParallelDSP/remove-duplicate-loads.ll
1 ↗(On Diff #190103)

Yeah, I'll update this patch now that I've abandoned the parent and this can become another smlad* test.

samparker updated this revision to Diff 190421.Mar 13 2019, 8:17 AM

I've rebased from D59257. I've also removed isProfitable and changed the remove-duplicate test to just an llc test.

samparker marked an inline comment as done.Mar 13 2019, 8:18 AM
samparker added inline comments.
test/CodeGen/ARM/debug-info-branch-folding.ll
1 ↗(On Diff #190421)

Please ignore, this shouldn't be here.

SjoerdMeijer accepted this revision.Mar 13 2019, 9:19 AM

Looks very reasonable to me

This revision is now accepted and ready to land.Mar 13 2019, 9:19 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2019, 4:13 AM