@@ -124,6 +124,39 @@ define <vscale x 8 x i1> @try_combine_svbool_binop_orr(<vscale x 8 x i1> %a, <vs
124124 ret <vscale x 8 x i1 > %t3
125125}
126126
127+ ; Verify predicate cast does not hinder "isAllActive" knowledge.
128+ define <vscale x 8 x half > @try_combine_svbool_binop_fadd (<vscale x 8 x half > %a , <vscale x 8 x half > %b ) {
129+ ; CHECK-LABEL: @try_combine_svbool_binop_fadd(
130+ ; CHECK-NEXT: [[T2:%.*]] = fadd <vscale x 8 x half> [[A:%.*]], [[B:%.*]]
131+ ; CHECK-NEXT: ret <vscale x 8 x half> [[T2]]
132+ ;
133+ %t1 = tail call <vscale x 8 x i1 > @llvm.aarch64.sve.convert.from.svbool.nxv8i1 (<vscale x 16 x i1 > splat (i1 true ))
134+ %t2 = tail call <vscale x 8 x half > @llvm.aarch64.sve.fadd.nxv8f16 (<vscale x 8 x i1 > %t1 , <vscale x 8 x half > %a , <vscale x 8 x half > %b )
135+ ret <vscale x 8 x half > %t2
136+ }
137+
138+ ; Verify predicate cast does not hinder "isAllActive" knowledge.
139+ define <vscale x 4 x float > @try_combine_svbool_binop_fmul (<vscale x 4 x float > %a , <vscale x 4 x float > %b ) {
140+ ; CHECK-LABEL: @try_combine_svbool_binop_fmul(
141+ ; CHECK-NEXT: [[T2:%.*]] = fmul <vscale x 4 x float> [[A:%.*]], [[B:%.*]]
142+ ; CHECK-NEXT: ret <vscale x 4 x float> [[T2]]
143+ ;
144+ %t1 = tail call <vscale x 4 x i1 > @llvm.aarch64.sve.convert.from.svbool.nxv4i1 (<vscale x 16 x i1 > splat (i1 true ))
145+ %t2 = tail call <vscale x 4 x float > @llvm.aarch64.sve.fmul.nxv4f32 (<vscale x 4 x i1 > %t1 , <vscale x 4 x float > %a , <vscale x 4 x float > %b )
146+ ret <vscale x 4 x float > %t2
147+ }
148+
149+ ; Verify predicate cast does not hinder "isAllActive" knowledge.
150+ define <vscale x 2 x double > @try_combine_svbool_binop_fsub (<vscale x 2 x double > %a , <vscale x 2 x double > %b ) {
151+ ; CHECK-LABEL: @try_combine_svbool_binop_fsub(
152+ ; CHECK-NEXT: [[T2:%.*]] = fsub <vscale x 2 x double> [[A:%.*]], [[B:%.*]]
153+ ; CHECK-NEXT: ret <vscale x 2 x double> [[T2]]
154+ ;
155+ %t1 = tail call <vscale x 2 x i1 > @llvm.aarch64.sve.convert.from.svbool.nxv2i1 (<vscale x 16 x i1 > splat (i1 true ))
156+ %t2 = tail call <vscale x 2 x double > @llvm.aarch64.sve.fsub.nxv2f64 (<vscale x 2 x i1 > %t1 , <vscale x 2 x double > %a , <vscale x 2 x double > %b )
157+ ret <vscale x 2 x double > %t2
158+ }
159+
127160declare <vscale x 16 x i1 > @llvm.aarch64.sve.convert.to.svbool.nxv8i1 (<vscale x 8 x i1 >)
128161declare <vscale x 16 x i1 > @llvm.aarch64.sve.convert.to.svbool.nxv4i1 (<vscale x 4 x i1 >)
129162declare <vscale x 16 x i1 > @llvm.aarch64.sve.convert.to.svbool.nxv2i1 (<vscale x 2 x i1 >)
0 commit comments