This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Hoist fabs/fneg above a conversion to float.
ClosedPublic

Authored by jmolloy on Aug 26 2015, 7:56 AM.

Details

Reviewers
qcolombet
jmolloy
Summary

This is especially visible in softfp mode, for example in the implementation of libm fabs/fneg functions. If we have:

%1 = vmovdrr r0, r1
%2 = fabs %1

then move the fabs before the vmovdrr:

%1 = and r1, #0x7FFFFFFF
%2 = vmovdrr r0, r1

This is never a lose, and could be a serious win because the vmovdrr may be followed by a vmovrrd, which would enable us to remove the conversion into FPRs completely.

We already do this for f32, but not for f64. Tests are added for both.

Diff Detail

Repository
rL LLVM

Event Timeline

jmolloy updated this revision to Diff 33200.Aug 26 2015, 7:56 AM
jmolloy retitled this revision from to [ARM] Hoist fabs/fneg above a conversion to float..
jmolloy updated this object.
jmolloy added a reviewer: qcolombet.
jmolloy set the repository for this revision to rL LLVM.
jmolloy added a subscriber: llvm-commits.

Hi Quentin,

I've added you as reviewer because of your work eliding cross class copies. Do you have any comments on this?

Cheers,
James

qcolombet edited edge metadata.Aug 28 2015, 10:33 AM

Hi James,

Sounds like a good idea.

Cheers,
-Quentin

jmolloy accepted this revision.Aug 29 2015, 3:52 AM
jmolloy added a reviewer: jmolloy.

Thanks Quentin,

Committed in r246360.

This revision is now accepted and ready to land.Aug 29 2015, 3:52 AM
jmolloy closed this revision.Aug 29 2015, 3:52 AM