This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Merge two adjacent str WZR into str XZR
ClosedPublic

Authored by junbuml on Feb 5 2016, 2:15 PM.

Details

Summary

This change merges adjacent 32 bit zero stores into a 64 bit zero store.
e.g.,

str wzr, [x0]
str wzr, [x0, #4]

becomes

str xzr, [x0]

Therefore, four adjacent 32 bit zero stores will be a single stp.
e.g.,

str wzr, [x0]
str wzr, [x0, #4]
str wzr, [x0, #8]
str wzr, [x0, #12]

becomes

stp xzr, xzr, [x0]

Diff Detail

Event Timeline

junbuml updated this revision to Diff 47044.Feb 5 2016, 2:15 PM
junbuml retitled this revision from to [AArch64] Merge two adjacent str WZR into str XZR.
junbuml updated this object.
junbuml added a subscriber: llvm-commits.
t.p.northover accepted this revision.Feb 5 2016, 2:27 PM
t.p.northover edited edge metadata.

Hi Jun,

I think this looks fine as code. Just a couple of minor grammatical nits before committing.

lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
636

I think you mean "isPromotableZeroStore" here.

1106

Again, "IsMergeableZeroStore" conveys the meaning better.

This revision is now accepted and ready to land.Feb 5 2016, 2:27 PM
junbuml updated this revision to Diff 47050.Feb 5 2016, 2:33 PM
junbuml updated this object.
junbuml edited edge metadata.

Addressed Tim's comments.
Thanks Tim for the very quick review!

Thanks Jun. Looks fine to me now.

Tim.

junbuml updated this revision to Diff 47720.Feb 11 2016, 1:29 PM

Applied it to current truck.

This revision was automatically updated to reflect the committed changes.