1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -dse < %s | FileCheck %s
4 declare void @llvm.memcpy.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i1) nounwind
5 declare void @llvm.memmove.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i1) nounwind
6 declare void @llvm.memset.p0i8.i8(i8* nocapture, i8, i8, i1) nounwind
10 ; CHECK-NEXT: ret void
15 store i8 0, i8* %A ;; Written to by memcpy
17 call void @llvm.memcpy.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i1 false)
22 define void @test2() {
23 ; CHECK-LABEL: @test2(
24 ; CHECK-NEXT: ret void
29 store i8 0, i8* %A ;; Written to by memmove
31 call void @llvm.memmove.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i1 false)
36 define void @test3() {
37 ; CHECK-LABEL: @test3(
38 ; CHECK-NEXT: ret void
43 store i8 0, i8* %A ;; Written to by memset
45 call void @llvm.memset.p0i8.i8(i8* %A, i8 0, i8 -1, i1 false)
50 declare void @llvm.memcpy.element.unordered.atomic.p0i16.p0i16.i16(i16* nocapture, i16* nocapture, i16, i32) nounwind
51 declare void @llvm.memmove.element.unordered.atomic.p0i16.p0i16.i16(i16* nocapture, i16* nocapture, i16, i32) nounwind
52 declare void @llvm.memset.element.unordered.atomic.p0i16.i16(i16* nocapture, i8, i16, i32) nounwind
55 define void @test4() {
56 ; CHECK-LABEL: @test4(
57 ; CHECK-NEXT: ret void
59 %A = alloca i16, i16 1024, align 2
60 %B = alloca i16, i16 1024, align 2
62 store atomic i16 0, i16* %A unordered, align 2 ;; Written to by memcpy
63 store atomic i16 0, i16* %B unordered, align 2 ;; Read by memcpy
65 call void @llvm.memcpy.element.unordered.atomic.p0i16.p0i16.i16(i16* align 2 %A, i16* align 2 %B, i16 1024, i32 2)
70 define void @test5() {
71 ; CHECK-LABEL: @test5(
72 ; CHECK-NEXT: ret void
74 %A = alloca i16, i16 1024, align 2
75 %B = alloca i16, i16 1024, align 2
77 store atomic i16 0, i16* %A unordered, align 2 ;; Written to by memmove
78 store atomic i16 0, i16* %B unordered, align 2 ;; Read by memmove
80 call void @llvm.memmove.element.unordered.atomic.p0i16.p0i16.i16(i16* align 2 %A, i16* align 2 %B, i16 1024, i32 2)
85 define void @test6() {
86 ; CHECK-LABEL: @test6(
87 ; CHECK-NEXT: ret void
89 %A = alloca i16, i16 1024, align 2
90 %B = alloca i16, i16 1024, align 2
92 store atomic i16 0, i16* %A unordered, align 2 ;; Written to by memset
94 call void @llvm.memset.element.unordered.atomic.p0i16.i16(i16* align 2 %A, i8 0, i16 1024, i32 2)