This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Do not emit HW loop with half precision operations
ClosedPublic

Authored by nemanjai on Jan 19 2021, 9:40 AM.

Details

Summary

If a loop has any operations on half precision values, there will be calls to library functions on Power8. Even on Power9, there is a small subset of instructions that are actually supported for the type.

This patch disables HW loops whenever any operations on the type are found (other than the handfull of supported ones when compiling for Power9). Fixes a few PR's opened by Julia:

https://bugs.llvm.org/show_bug.cgi?id=48785
https://bugs.llvm.org/show_bug.cgi?id=48786
https://bugs.llvm.org/show_bug.cgi?id=48519

Diff Detail

Event Timeline

nemanjai created this revision.Jan 19 2021, 9:40 AM
nemanjai requested review of this revision.Jan 19 2021, 9:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 9:40 AM
vchuravy accepted this revision.Jan 19 2021, 7:20 PM

That does seem to indeed fix all the remaining issues with Float16 that the Julia testsuite covers :)

This revision is now accepted and ready to land.Jan 19 2021, 7:20 PM
NeHuang added inline comments.
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
388

nit: clang format

bsaleil accepted this revision.Jan 22 2021, 2:27 PM
bsaleil added a subscriber: bsaleil.

LGTM

This revision was landed with ongoing or failed builds.Jan 25 2021, 6:56 PM
This revision was automatically updated to reflect the committed changes.