This is an archive of the discontinued LLVM Phabricator instance.

[X86] Implement old kunpck intrinsics using vector ops on vXi1 instead of integer shift/and/or
ClosedPublic

Authored by craig.topper on Jan 12 2018, 4:02 PM.

Details

Summary

kunpck intrinsics were removed in favor of native IR a few months ago. The implementation lowers them as by operation on the integer types passed to the intrinsic and then just shifting, masking, and oring them together. A special X86 DAG combine was added to recognize this patter and turn it into a concat_vector operation.

I think it makes more sense to keep the IR implementation closer to vector operations on vXi1. Given that we expect these builtins to be used around other builtins that operate on k-registers which we try to represent in IR with vXi1. InstCombine should be able to get rid of the bitcasts between integers and vXi1 leaving only the vector operations.

I'll post an llvm patch for the autoupgrade for this as well.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jan 12 2018, 4:02 PM
craig.topper edited subscribers, added: cfe-commits; removed: llvm-commits.Jan 12 2018, 4:18 PM
RKSimon accepted this revision.Jan 13 2018, 6:54 AM

I agree keeping them as vector types makes more sense, assuming the vXi1 handling and bitcasts to/from integer types are up to snuff.

This revision is now accepted and ready to land.Jan 13 2018, 6:54 AM
This revision was automatically updated to reflect the committed changes.