This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Improve SINT_TO_FP of boolean vector results (signum)
ClosedPublic

Authored by RKSimon on Nov 12 2016, 4:29 PM.

Details

Summary

This patch helps avoids poor legalization of boolean vector results (e.g. 8f32 -> 8i1 -> 8i16) that feed into SINT_TO_FP by inserting an early SIGN_EXTEND and so help improve the truncation logic.

This is not necessary for AVX512 targets where boolean vectors are legal.

Fix for PR13248

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 77731.Nov 12 2016, 4:29 PM
RKSimon retitled this revision from to [X86][SSE] Improve SINT_TO_FP of boolean vector results (signum).
RKSimon updated this object.
RKSimon added reviewers: zvi, craig.topper, spatel, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
zvi edited edge metadata.Nov 14 2016, 4:33 AM

This patch LGTM, but could you please explain this part in the summary? "This is not necessary for AVX512 targets where boolean vectors are legal."
Apparently, this also helps AVX512 targets when the vector of i1's is not legal.

In D26583#594186, @zvi wrote:

This patch LGTM, but could you please explain this part in the summary? "This is not necessary for AVX512 targets where boolean vectors are legal."
Apparently, this also helps AVX512 targets when the vector of i1's is not legal.

AVX512 manages to lower ( sint_to_fp vXi1 ) into some form of ( select mask, 1.0f , 0.0f ) in most cases.

OK to commit?

zvi added a comment.Nov 15 2016, 6:56 AM

OK to commit?

LGTM, but maybe another reviewer can take a look?

spatel accepted this revision.Nov 15 2016, 7:46 AM
spatel edited edge metadata.

LGTM.
Side note: the sll/sra pairs reminded me of the vector TODO remaining from D25485 / rL284611.

This revision is now accepted and ready to land.Nov 15 2016, 7:46 AM
This revision was automatically updated to reflect the committed changes.