Original patch by @rogfer01.
This patch adds support for sign-, zero-, and any-extension from
scalable mask vector types to integer vector types, as well as
truncation in the opposite direction.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Fraser Cormack <fraser@codeplay.com>
trunc would probably be better custom lowered. We should be able to remove the AND if the input has enough 0 bits. Not sure if SimplifyDemandedBits is capable of that for scalable vectors yet.
sext/zext/anyext might also be better custom lowered just to cut down on patterns. Our isel table is approaching 1MB. The next largest target is at about 600K.