This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Replace float load/store pair with integer load/store pair when it's only used in load/store
ClosedPublic

Authored by wuzish on Jul 4 2019, 1:10 AM.

Details

Summary

Replace float load/store pair with integer load/store pair when it's only used in load/store, because float load/store instructions cost more cycles then integer load/store.

A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack. So we need a load/store pair to do such memory operation if the variable is global variable.

Diff Detail

Repository
rL LLVM

Event Timeline

wuzish created this revision.Jul 4 2019, 1:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2019, 1:10 AM
MaskRay added a subscriber: MaskRay.Jul 4 2019, 6:48 AM

gentle pin... It's a follow-up of https://reviews.llvm.org/D60601

jsji requested changes to this revision.Jul 15 2019, 6:57 AM

In theory this should be a good idea, especially with P9, we can remove the "restrict" dispatch constraints for lfs/lfd.

Can you get some performance data w and w/o this?

Request change to split the NFC patch out. Thanks.

lib/Target/PowerPC/PPCISelLowering.h
832 ↗(On Diff #207979)

Please add some comments here about why we deem it is profitable?

833 ↗(On Diff #207979)

Maybe it would be better to be explicit here, check for f32 and f64 only?

test/CodeGen/PowerPC/float-load-store-pair.ll
4 ↗(On Diff #207979)

Please commit the testcase in a NFC patch first, then only show difference here.

This revision now requires changes to proceed.Jul 15 2019, 6:57 AM

Address comments

This comment was removed by wuzish.

After run bmk 2017 cpu for fortran and c/c++, there is some noise, no obvious degression. Some have little improvement about 1%~2%.

jsji accepted this revision.Jul 22 2019, 8:25 AM

LGTM.

This revision is now accepted and ready to land.Jul 22 2019, 8:25 AM
This revision was automatically updated to reflect the committed changes.