This is an archive of the discontinued LLVM Phabricator instance.

[AArch64]Enable the narrow ld promotion only on profitable microarchitectures
ClosedPublic

Authored by junbuml on Nov 2 2015, 9:12 AM.

Details

Summary

The benefit from converting narrow loads into a wider loads (r251438) could be
micro-architecturally dependent, as it assumes that a single load with two bitfield
extracts is cheaper than two narrow loads. Currently, this conversion is enabled
only in cortex-a57 on which performance benefits were verified.

Diff Detail

Event Timeline

junbuml updated this revision to Diff 38936.Nov 2 2015, 9:12 AM
junbuml retitled this revision from to [AArch64]Enable the narrow ld promotion only on profitable microarchitectures.
junbuml updated this object.
junbuml added reviewers: jmolloy, mcrosier, ab, mzolotukhin.
junbuml added a subscriber: llvm-commits.
mcrosier added inline comments.Nov 2 2015, 9:29 AM
lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
1196

Why not call enableNarrowLdMerge(MBB->getParent()) here? You would need to change the logic in enableNarrowLdMerge since you're passing in a pointer to the MF, but that should be trivial.

1379

How about enableNarrowLdMerge, rather than couldNarrowLdMergeEnabled?

1395

I'd still prefer we sink this check into the optimizeBlock() function.

junbuml updated this revision to Diff 38944.Nov 2 2015, 10:59 AM

Thanks Chad for the review. I addressed your comments.

mcrosier accepted this revision.Nov 2 2015, 11:11 AM
mcrosier edited edge metadata.

LGTM. Thanks, Jun.

lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
1395

Jun and I discussed this offline. We shouldn't sink this because we don't need to call this predicate for every function. The answer will always be the same, so we only call it once in the runOnFunction function.

This revision is now accepted and ready to land.Nov 2 2015, 11:11 AM
junbuml closed this revision.Nov 6 2015, 8:31 AM

committed in r252316.