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 3 4 5target triple = "x86_64-unknown-linux-gnu" 6 7define void @merge_double(double* noalias nocapture %st, double* noalias nocapture readonly %ld) #0 { 8; CHECK-LABEL: merge_double: 9; CHECK: # %bb.0: 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) 16; CHECK-NEXT: retq 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 20 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 24 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 29 ret void 30} 31 32define 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) 41; CHECK-NEXT: retq 42entry: 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 53 ret void 54} 55 56define 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) 65; CHECK-NEXT: retq 66entry: 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 77 ret i64 %0 78 79} 80 81attributes #0 = { "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" } 82 83 84!0 = !{!"clang version 5.0.0 (trunk 296467) (llvm/trunk 296476)"} 85!1 = !{!2, !2, i64 0} 86!2 = !{!"double", !3, i64 0} 87!3 = !{!"omnipotent char", !4, i64 0} 88!4 = !{!"Simple C/C++ TBAA"} 89