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
[AArch64] Add invalid 1 x vscale costs for reductions and reduction-operations. (#102105)
The code-generator is currently not able to handle scalable vectors of
<vscale x 1 x eltty>. The usual "fix" for this until it is supported is
to mark the costs of loads/stores with an invalid cost, preventing the
vectorizer from vectorizing at those factors. But on rare occasions
loops do not contain load/stores, only reductions.
So whilst this is still unsupported return an invalid cost to avoid
selecting vscale x 1 VFs. The cost of a reduction is not currently used
by the vectorizer so this adds the cost to the add/mul/and/or/xor or
min/max that should feed the reduction. It includes reduction costs
too, for completeness. This change will be removed when code-generation
for these types is sufficiently reliable.
Fixes#99760
(cherry picked from commit 0b745a1)
Copy file name to clipboardExpand all lines: llvm/test/Analysis/CostModel/AArch64/cttz_elts.ll
+2
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
4
4
definevoid@foo_no_vscale_range() {
5
5
; CHECK-LABEL: 'foo_no_vscale_range'
6
+
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %res.i64.nxv1i1.zip = call i64 @llvm.experimental.cttz.elts.i64.nxv1i1(<vscale x 1 x i1> undef, i1 true)
6
7
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res.i64.nxv2i1.zip = call i64 @llvm.experimental.cttz.elts.i64.nxv2i1(<vscale x 2 x i1> undef, i1 true)
7
8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res.i64.nxv4i1.zip = call i64 @llvm.experimental.cttz.elts.i64.nxv4i1(<vscale x 4 x i1> undef, i1 true)
8
9
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res.i64.nxv8i1.zip = call i64 @llvm.experimental.cttz.elts.i64.nxv8i1(<vscale x 8 x i1> undef, i1 true)
; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res.i32.v32i1.nzip = call i32 @llvm.experimental.cttz.elts.i32.v32i1(<32 x i1> undef, i1 false)
46
47
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
47
48
;
49
+
%res.i64.nxv1i1.zip = calli64@llvm.experimental.cttz.elts.i64.nxv1i1(<vscale x 1 x i1> undef, i1true)
48
50
%res.i64.nxv2i1.zip = calli64@llvm.experimental.cttz.elts.i64.nxv2i1(<vscale x 2 x i1> undef, i1true)
49
51
%res.i64.nxv4i1.zip = calli64@llvm.experimental.cttz.elts.i64.nxv4i1(<vscale x 4 x i1> undef, i1true)
50
52
%res.i64.nxv8i1.zip = calli64@llvm.experimental.cttz.elts.i64.nxv8i1(<vscale x 8 x i1> undef, i1true)
0 commit comments