This is an archive of the discontinued LLVM Phabricator instance.

[x86] use vector instructions to lower even more FP->int->FP casts
ClosedPublic

Authored by spatel on Apr 23 2020, 2:03 PM.

Details

Summary

This is another enhancement to D77895/D78362 to avoid a round-trip from XMM->GPR->XMM.
This time we handle the case of starting/ending with different FP types but always with signed i32 as the intermediate value.
I think this covers all of the faux vector optimization possibilities for pre-AVX512.

There is at least 1 other transform mentioned in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c19
...where we fold an 'fpext' into a preceding 'sitofp'. I think we will want to handle that earlier (DAGCombiner or instcombine) because that's a target-independent optimization.

Diff Detail

Event Timeline

spatel created this revision.Apr 23 2020, 2:03 PM
This revision is now accepted and ready to land.Apr 23 2020, 2:42 PM
RKSimon accepted this revision.Apr 24 2020, 2:04 AM

LGTM - cheers!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2020, 9:00 AM