This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Refactoring aarch64-ldst-opt. NCF
ClosedPublic

Authored by junbuml on Nov 19 2015, 9:58 AM.

Details

Reviewers
jmolloy
mcrosier
Summary

Summary :

  • Rename isSmallTypeLdMerge() to isNarrowLoad().
  • Rename NumSmallTypeMerged to NumNarrowTypePromoted.
  • Use Subtarget defined as a member variable.

Diff Detail

Event Timeline

junbuml updated this revision to Diff 40671.Nov 19 2015, 9:58 AM
junbuml retitled this revision from to [AArch64] Refactoring aarch64-ldst-opt. NCF.
junbuml updated this object.

This is minor refactorings mentioned in D14183.

mcrosier accepted this revision.Nov 19 2015, 10:19 AM
mcrosier edited edge metadata.

LGTM with a few nits.

lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
44

Currently, this is only applicable to loads, correct? I'd be in favor of

STATISTIC(NumNarrowLoadsPromoted, "Number of narrow loads promoted");

When your next patch for zero stores lands you can add an equivalent stat for stores.

1230

NumNarrowTypePromoted -> NumNarrowLoadsPromoted

1470

Shouldn't this be a logical and (i.e., &&)?

No need for the extra parens around !Subtarget->requiresStrictAlign().

Specifically,

return ProfitableArch && !Subtarget->requiresStrictAlign();

This revision is now accepted and ready to land.Nov 19 2015, 10:19 AM
junbuml added inline comments.Nov 19 2015, 10:26 AM
lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
44

OK. I will isolate this only for load.

1470

You are right ! Thanks for catching this. I will fix it.

junbuml updated this revision to Diff 40677.Nov 19 2015, 10:43 AM
junbuml edited edge metadata.

Addressed Chad's comments

junbuml closed this revision.Nov 19 2015, 10:47 AM

committed in r253587.