1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -o - | FileCheck %s
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @merge_double(double* noalias nocapture %st, double* noalias nocapture readonly %ld) #0 {
8 ; CHECK-LABEL: merge_double:
10 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
11 ; CHECK-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
12 ; CHECK-NEXT: movsd %xmm0, (%rdi)
13 ; CHECK-NEXT: movsd %xmm1, 8(%rdi)
14 ; CHECK-NEXT: movsd %xmm0, 16(%rdi)
15 ; CHECK-NEXT: movsd %xmm1, 24(%rdi)
17 %ld_idx1 = getelementptr inbounds double, double* %ld, i64 1
18 %ld0 = load double, double* %ld, align 8, !tbaa !2
19 %ld1 = load double, double* %ld_idx1, align 8, !tbaa !2
21 %st_idx1 = getelementptr inbounds double, double* %st, i64 1
22 %st_idx2 = getelementptr inbounds double, double* %st, i64 2
23 %st_idx3 = getelementptr inbounds double, double* %st, i64 3
25 store double %ld0, double* %st, align 8, !tbaa !2
26 store double %ld1, double* %st_idx1, align 8, !tbaa !2
27 store double %ld0, double* %st_idx2, align 8, !tbaa !2
28 store double %ld1, double* %st_idx3, align 8, !tbaa !2
32 define void @merge_loadstore_int(i64* noalias nocapture readonly %p, i64* noalias nocapture %q) local_unnamed_addr #0 {
33 ; CHECK-LABEL: merge_loadstore_int:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: movq (%rdi), %rax
36 ; CHECK-NEXT: movq 8(%rdi), %rcx
37 ; CHECK-NEXT: movq %rax, (%rsi)
38 ; CHECK-NEXT: movq %rcx, 8(%rsi)
39 ; CHECK-NEXT: movq %rax, 16(%rsi)
40 ; CHECK-NEXT: movq %rcx, 24(%rsi)
43 %0 = load i64, i64* %p, align 8, !tbaa !1
44 %arrayidx1 = getelementptr inbounds i64, i64* %p, i64 1
45 %1 = load i64, i64* %arrayidx1, align 8, !tbaa !1
46 store i64 %0, i64* %q, align 8, !tbaa !1
47 %arrayidx3 = getelementptr inbounds i64, i64* %q, i64 1
48 store i64 %1, i64* %arrayidx3, align 8, !tbaa !1
49 %arrayidx4 = getelementptr inbounds i64, i64* %q, i64 2
50 store i64 %0, i64* %arrayidx4, align 8, !tbaa !1
51 %arrayidx5 = getelementptr inbounds i64, i64* %q, i64 3
52 store i64 %1, i64* %arrayidx5, align 8, !tbaa !1
56 define i64 @merge_loadstore_int_with_extra_use(i64* noalias nocapture readonly %p, i64* noalias nocapture %q) local_unnamed_addr #0 {
57 ; CHECK-LABEL: merge_loadstore_int_with_extra_use:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: movq (%rdi), %rax
60 ; CHECK-NEXT: movq 8(%rdi), %rcx
61 ; CHECK-NEXT: movq %rax, (%rsi)
62 ; CHECK-NEXT: movq %rcx, 8(%rsi)
63 ; CHECK-NEXT: movq %rax, 16(%rsi)
64 ; CHECK-NEXT: movq %rcx, 24(%rsi)
67 %0 = load i64, i64* %p, align 8, !tbaa !1
68 %arrayidx1 = getelementptr inbounds i64, i64* %p, i64 1
69 %1 = load i64, i64* %arrayidx1, align 8, !tbaa !1
70 store i64 %0, i64* %q, align 8, !tbaa !1
71 %arrayidx3 = getelementptr inbounds i64, i64* %q, i64 1
72 store i64 %1, i64* %arrayidx3, align 8, !tbaa !1
73 %arrayidx4 = getelementptr inbounds i64, i64* %q, i64 2
74 store i64 %0, i64* %arrayidx4, align 8, !tbaa !1
75 %arrayidx5 = getelementptr inbounds i64, i64* %q, i64 3
76 store i64 %1, i64* %arrayidx5, align 8, !tbaa !1
81 attributes #0 = { "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" }
84 !0 = !{!"clang version 5.0.0 (trunk 296467) (llvm/trunk 296476)"}
86 !2 = !{!"double", !3, i64 0}
87 !3 = !{!"omnipotent char", !4, i64 0}
88 !4 = !{!"Simple C/C++ TBAA"}