This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][LegalizeFloatTypes] Move the PPC hacks for (i32 fp_to_sint/fp_to_uint (ppcf128 X)) out of LegalizeFloatTypes and into PPC specific code
ClosedPublic

Authored by craig.topper on Mar 2 2018, 5:03 PM.

Details

Summary

I'm not entirely sure these hacks are still needed. If you remove the hacks completely, the name of the library call that gets generated doesn't match the grep the test previously had. So the test wasn't really checking anything.

If the hack is still needed it belongs in PPC specific code. I believe the FP_TO_SINT code here is the only place in the tree where a FP_ROUND_INREG node is created today. And I don't think its even being used correctly because the legalization returned a BUILD_PAIR with the same value twice. That doesn't seem right to me. By moving the code entirely to PPC we can avoid creating the FP_ROUND_INREG at all.

I replace the grep in the existing test with full checks generated by hacking update_llc_test_check.py to support ppc32 just long enough to generate it. I can commit that ahead if this patch if desired.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 2 2018, 5:03 PM
nemanjai accepted this revision.Mar 19 2018, 3:51 PM

Nothing about this patch strikes me as controversial. I do believe there may be places where the hack might be needed as it is entirely possible that some PPC 32-bit environments are on old glibc versions.
Thank you for the patch Craig.

LGTM.

This revision is now accepted and ready to land.Mar 19 2018, 3:51 PM
This revision was automatically updated to reflect the committed changes.