You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LLVM][InstCombine][SVE] Improve isAllActivePredicate by looking through from.svbool.
When a predicate is of the form "%a = sve.from.vsbool(%b) we know all
bits in %a come from %b and thus if %b is all true then %a must also
be all true.
Copy file name to clipboardExpand all lines: llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-to-svbool-binops.ll
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -127,8 +127,7 @@ define <vscale x 8 x i1> @try_combine_svbool_binop_orr(<vscale x 8 x i1> %a, <vs
127
127
; Verify predicate cast does not hinder "isAllActive" knowledge.
128
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
129
; CHECK-LABEL: @try_combine_svbool_binop_fadd(
130
-
; CHECK-NEXT: [[T1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> splat (i1 true))
131
-
; CHECK-NEXT: [[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:%.*]])
130
+
; CHECK-NEXT: [[T2:%.*]] = fadd <vscale x 8 x half> [[A:%.*]], [[B:%.*]]
132
131
; CHECK-NEXT: ret <vscale x 8 x half> [[T2]]
133
132
;
134
133
%t1 = tailcall <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> splat (i1true))
@@ -139,8 +138,7 @@ define <vscale x 8 x half> @try_combine_svbool_binop_fadd(<vscale x 8 x half> %a
139
138
; Verify predicate cast does not hinder "isAllActive" knowledge.
140
139
define <vscale x 4 x float> @try_combine_svbool_binop_fmul(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
141
140
; CHECK-LABEL: @try_combine_svbool_binop_fmul(
142
-
; CHECK-NEXT: [[T1:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> splat (i1 true))
143
-
; CHECK-NEXT: [[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:%.*]])
141
+
; CHECK-NEXT: [[T2:%.*]] = fmul <vscale x 4 x float> [[A:%.*]], [[B:%.*]]
144
142
; CHECK-NEXT: ret <vscale x 4 x float> [[T2]]
145
143
;
146
144
%t1 = tailcall <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> splat (i1true))
@@ -151,8 +149,7 @@ define <vscale x 4 x float> @try_combine_svbool_binop_fmul(<vscale x 4 x float>
151
149
; Verify predicate cast does not hinder "isAllActive" knowledge.
152
150
define <vscale x 2 x double> @try_combine_svbool_binop_fsub(<vscale x 2 x double> %a, <vscale x 2 x double> %b) {
153
151
; CHECK-LABEL: @try_combine_svbool_binop_fsub(
154
-
; CHECK-NEXT: [[T1:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> splat (i1 true))
155
-
; CHECK-NEXT: [[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:%.*]])
152
+
; CHECK-NEXT: [[T2:%.*]] = fsub <vscale x 2 x double> [[A:%.*]], [[B:%.*]]
156
153
; CHECK-NEXT: ret <vscale x 2 x double> [[T2]]
157
154
;
158
155
%t1 = tailcall <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> splat (i1true))
0 commit comments