|
| 1 | +; 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 | +define void @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]]), !alias.scope [[META0:![0-9]+]], !noalias [[META5:![0-9]+]] |
| 11 | +; CHECK-NEXT: ret void |
| 12 | +; |
| 13 | + call void @llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32> %v1, ptr nonnull %a, <vscale x 8 x i1> splat (i1 true), i32 %vl), !alias.scope !34, !noalias !37 |
| 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 (i1 true), i32 %vl) |
| 15 | + 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), !alias.scope !34, !noalias !37 |
| 16 | + ret void |
| 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 | +declare void @llvm.vp.store.nxv8i32.p0(<vscale x 8 x i32>, ptr nocapture, <vscale x 8 x i1>, i32) |
| 21 | + |
| 22 | +!11 = !{!"omnipotent char", !12, i64 0} |
| 23 | +!12 = !{!"Simple C/C++ TBAA"} |
| 24 | +!13 = !{!"int", !11, i64 0} |
| 25 | +!16 = !{!13, !13, i64 0} |
| 26 | +!28 = distinct !{!28, !"LVerDomain"} |
| 27 | +!30 = distinct !{!30, !"LVerDomain"} |
| 28 | +!34 = !{!35, !36} |
| 29 | +!35 = distinct !{!35, !28} |
| 30 | +!36 = distinct !{!36, !30} |
| 31 | +!37 = !{!38, !39} |
| 32 | +!38 = distinct !{!38, !28} |
| 33 | +!39 = distinct !{!39, !28} |
0 commit comments