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
[DSE] Add predicated vector length store support for masked store elimination
In isMaskedStoreOverwrite we process two stores that fully overwrite one
another, here we add support for predicated vector length stores so that
DSE will eliminate this variant of masked stores.
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
+
; RUN: opt -passes=dse -S < %s | FileCheck %s
3
+
4
+
; Test predicated vector length masked stores for elimination
5
+
6
+
definevoid@foo(ptr%a, i32%vl, <vscale x 8 x i32> %v1, <vscale x 8 x i32> %v2) {
7
+
;
8
+
; CHECK-LABEL: @foo(
9
+
; CHECK-NEXT: [[VP_OP:%.*]] = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> [[V1:%.*]], <vscale x 8 x i32> [[V2:%.*]], <vscale x 8 x i1> splat (i1 true), i32 [[VL:%.*]])
10
+
; CHECK-NEXT: call void @llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32> [[VP_OP]], ptr nonnull [[A:%.*]], <vscale x 8 x i1> splat (i1 true), i32 [[VL]])
11
+
; CHECK-NEXT: ret void
12
+
;
13
+
callvoid@llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32> %v1, ptrnonnull%a, <vscale x 8 x i1> splat (i1true), i32%vl)
14
+
%vp.op = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %v1, <vscale x 8 x i32> %v2, <vscale x 8 x i1> splat (i1true), i32%vl)
15
+
callvoid@llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32> %vp.op, ptrnonnull%a, <vscale x 8 x i1> splat (i1true), i32%vl)
16
+
retvoid
17
+
}
18
+
19
+
declare <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
20
+
declarevoid@llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32>, ptrnocapture, <vscale x 8 x i1>, i32)
0 commit comments