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
[DAGCombiner][SVE] Ensure MGATHER/MSCATTER addressing mode combines preserve index scaling
refineUniformBase and selectGatherScatterAddrMode both attempt the
transformation:
base(0) + index(A+splat(B)) => base(B) + index(A)
However, this is only safe when index is not implicitly scaled.
Differential Revision: https://reviews.llvm.org/D123222
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/AArch64/sve-gather-scatter-addr-opts.ll
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -343,12 +343,13 @@ define <vscale x 2 x i64> @masked_gather_nxv2i64_const_with_vec_offsets(<vscale
343
343
ret <vscale x 2 x i64> %data
344
344
}
345
345
346
-
; TODO: The generated code is wrong because we've lost the scaling applied to
347
-
; %scalar_offset when it's used to calculate %ptrs.
348
346
define <vscale x 2 x i64> @masked_gather_nxv2i64_null_with_vec_plus_scalar_offsets(<vscale x 2 x i64> %vector_offsets, i64%scalar_offset, <vscale x 2 x i1> %pg) #0 {
%scalar_offset.ins = insertelement <vscale x 2 x i64> undef, i641, i640
@@ -425,12 +425,13 @@ define void @masked_scatter_nxv2i64_const_with_vec_offsets(<vscale x 2 x i64> %v
425
425
retvoid
426
426
}
427
427
428
-
; TODO: The generated code is wrong because we've lost the scaling applied to
429
-
; %scalar_offset when it's used to calculate %ptrs.
430
428
definevoid@masked_scatter_nxv2i64_null_with_vec_plus_scalar_offsets(<vscale x 2 x i64> %vector_offsets, i64%scalar_offset, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %data) #0 {
%scalar_offset.ins = insertelement <vscale x 2 x i64> undef, i64%scalar_offset, i640
436
437
%scalar_offset.splat = shufflevector <vscale x 2 x i64> %scalar_offset.ins, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
@@ -440,12 +441,11 @@ define void @masked_scatter_nxv2i64_null_with_vec_plus_scalar_offsets(<vscale x
440
441
retvoid
441
442
}
442
443
443
-
; TODO: The generated code is wrong because we've lost the scaling applied to
444
-
; constant scalar offset (i.e. i64 1) when it's used to calculate %ptrs.
445
444
definevoid@masked_scatter_nxv2i64_null_with__vec_plus_imm_offsets(<vscale x 2 x i64> %vector_offsets, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %data) #0 {
0 commit comments