[AArch64][SVE] Improve sve.convert.to.svbool lowering

Authored by peterwaller-arm on Apr 29 2021, 8:40 AM.


[AArch64][SVE] Improve sve.convert.to.svbool lowering

The sve.convert.to.svbool lowering has the effect of widening a logical
<M x i1> vector representing lanes into a physical <16 x i1> vector
representing bits in a predicate register.

In general, if converting to svbool, the contents of lanes in the
physical register might not be known. For sve.convert.to.svbool the new
lanes are specified to be zeroed, requiring 'and' instructions to mask
off the new lanes. For lanes coming from a ptrue or a comparison,
however, they are known to be zero.

CodeGen Before:

ptrue p0.s, vl16
ptrue p1.s
ptrue p2.b
and   p0.b, p2/z, p0.b, p1.b


ptrue	p0.s, vl16

Differential Revision: https://reviews.llvm.org/D101544