This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper for FP_TO_SINT/UINT.
ClosedPublic

Authored by craig.topper on Nov 26 2018, 9:58 AM.

Details

Summary

SplitVecOp_TruncateHelper tries to promote the result type while splitting FP_TO_SINT/UINT. It then concatenates the result and introduces a truncate to the original result type. But it does this without inserting the AssertZExt/AssertSExt that the regular result type promotion would insert. Nor does it turn FP_TO_UINT into FP_TO_SINT the way normal result type promotion for these operations does. This is bad on X86 which doesn't support FP_TO_SINT until AVX512.

This patch disables the use of SplitVecOp_TruncateHelper for these operations and just lets normal promotion handle it. I've tweaked a couple things in X86ISelLowering to avoid a few obvious regressions there. I believe all the changes on X86 are improvements. Not sure about the other targets, but it doesn't look obviously worse.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Nov 26 2018, 9:58 AM

The PPC changes seem to be neutral, so no objection from me. Would you mind adding a comment to https://reviews.llvm.org/D54663 if this gets committed before that one as I'll have to update the patch? I'll do the same if I commit mine first.

AArch64 changes look fine.

spatel accepted this revision.Nov 26 2018, 12:57 PM

x86 diffs look like wins, so LGTM.

This revision is now accepted and ready to land.Nov 26 2018, 12:57 PM
This revision was automatically updated to reflect the committed changes.