void __attribute__((no, noclone))
vec_slp_double(double *restrict a, double *restrict b, int n) {
  for (int i = 0; i < n; ++i) {
    a[i * 2] += 1;
    a[i * 2 + 1] += 2;
    b[i * 4] += 3;
    b[i * 4 + 1] += 4;
    b[i * 4 + 2] += 5;
    b[i * 4 + 3] += 6;
  }
}


x86 assembly (clang, -O0):
<vec_slp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f6 <vec_slp_double+0xf6>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xef1(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xec7(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xea0(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe76(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xe4c(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  0xe22(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <vec_slp_double+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_slp_double>:
test   %edx,%edx
jle    1276 <vec_slp_double+0x176>
mov    %edx,%r8d
cmp    $0x1,%edx
jne    1117 <vec_slp_double+0x17>
xor    %ecx,%ecx
jmp    1217 <vec_slp_double+0x117>
mov    %r8d,%ecx
and    $0xfffffffe,%ecx
xor    %edx,%edx
movapd 0xed8(%rip),%xmm8
movapd 0xedf(%rip),%xmm9
movapd 0xee6(%rip),%xmm10
movapd 0xeed(%rip),%xmm11
movapd 0xef5(%rip),%xmm4
movapd 0xefd(%rip),%xmm5
mov    %rcx,%rax
cs nopw 0x0(%rax,%rax,1)
movupd (%rdi,%rdx,1),%xmm0
movupd 0x10(%rdi,%rdx,1),%xmm7
movapd %xmm0,%xmm6
unpcklpd %xmm7,%xmm6
unpckhpd %xmm7,%xmm0
addpd  %xmm8,%xmm6
addpd  %xmm9,%xmm0
movapd %xmm6,%xmm7
unpckhpd %xmm0,%xmm7
unpcklpd %xmm0,%xmm6
movupd %xmm6,(%rdi,%rdx,1)
movupd %xmm7,0x10(%rdi,%rdx,1)
movupd (%rsi,%rdx,2),%xmm0
movupd 0x10(%rsi,%rdx,2),%xmm6
movupd 0x20(%rsi,%rdx,2),%xmm7
movupd 0x30(%rsi,%rdx,2),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm7,%xmm2
unpckhpd %xmm7,%xmm0
movapd %xmm6,%xmm7
unpcklpd %xmm1,%xmm7
unpckhpd %xmm1,%xmm6
addpd  %xmm10,%xmm2
addpd  %xmm11,%xmm0
addpd  %xmm4,%xmm7
addpd  %xmm5,%xmm6
movapd %xmm7,%xmm1
unpcklpd %xmm6,%xmm1
movapd %xmm2,%xmm3
unpcklpd %xmm0,%xmm3
movhlps %xmm7,%xmm6
movhlps %xmm2,%xmm0
movups %xmm0,0x20(%rsi,%rdx,2)
movups %xmm6,0x30(%rsi,%rdx,2)
movupd %xmm3,(%rsi,%rdx,2)
movupd %xmm1,0x10(%rsi,%rdx,2)
add    $0x20,%rdx
add    $0xfffffffffffffffe,%rax
jne    1160 <vec_slp_double+0x60>
cmp    %r8,%rcx
je     1276 <vec_slp_double+0x176>
sub    %rcx,%r8
shl    $0x4,%rcx
movapd 0xe3a(%rip),%xmm0
movapd 0xe42(%rip),%xmm1
movapd 0xe4a(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
movupd (%rdi,%rcx,1),%xmm3
addpd  %xmm0,%xmm3
movupd %xmm3,(%rdi,%rcx,1)
movupd (%rsi,%rcx,2),%xmm3
movupd 0x10(%rsi,%rcx,2),%xmm4
addpd  %xmm1,%xmm3
movupd %xmm3,(%rsi,%rcx,2)
addpd  %xmm2,%xmm4
movupd %xmm4,0x10(%rsi,%rcx,2)
add    $0x10,%rcx
add    $0xffffffffffffffff,%r8
jne    1240 <vec_slp_double+0x140>
ret

LLVM IR (-O0):
define void @vec_slp_double(double* noalias %0, double* noalias %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %59, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %62
12: ; preds = %8
%13 = load double*, double** %4
%14 = load i32, i32* %7
%15 = mul nsw i32 %14, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %13, i64 %16
%18 = load double, double* %17
%19 = fadd double %18, 1.000000e+00
store double %19, double* %17
%20 = load double*, double** %4
%21 = load i32, i32* %7
%22 = mul nsw i32 %21, 2
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %20, i64 %24
%26 = load double, double* %25
%27 = fadd double %26, 2.000000e+00
store double %27, double* %25
%28 = load double*, double** %5
%29 = load i32, i32* %7
%30 = mul nsw i32 %29, 4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %28, i64 %31
%33 = load double, double* %32
%34 = fadd double %33, 3.000000e+00
store double %34, double* %32
%35 = load double*, double** %5
%36 = load i32, i32* %7
%37 = mul nsw i32 %36, 4
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %35, i64 %39
%41 = load double, double* %40
%42 = fadd double %41, 4.000000e+00
store double %42, double* %40
%43 = load double*, double** %5
%44 = load i32, i32* %7
%45 = mul nsw i32 %44, 4
%46 = add nsw i32 %45, 2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %43, i64 %47
%49 = load double, double* %48
%50 = fadd double %49, 5.000000e+00
store double %50, double* %48
%51 = load double*, double** %5
%52 = load i32, i32* %7
%53 = mul nsw i32 %52, 4
%54 = add nsw i32 %53, 3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %51, i64 %55
%57 = load double, double* %56
%58 = fadd double %57, 6.000000e+00
store double %58, double* %56
br label %59
59: ; preds = %12
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %8
62: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vec_slp_double(double* noalias nocapture %0, double* noalias nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %50
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = icmp eq i32 %2, 1
br i1 %7, label %48, label %8
8: ; preds = %5
%9 = and i64 %6, 4294967294
%10 = getelementptr inbounds double, double* %0, i64 -1
%11 = getelementptr inbounds double, double* %1, i64 -3
br label %12
12: ; preds = %12, %8
%13 = phi i64 [ 0, %8 ], [ %44, %12 ]
%14 = shl nuw nsw i64 %13, 1
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = bitcast double* %15 to <4 x double>*
%17 = load <4 x double>, <4 x double>* %16
%18 = shufflevector <4 x double> %17, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%19 = shufflevector <4 x double> %17, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%20 = fadd <2 x double> %18, <double 1.000000e+00, double 1.000000e+00>
%21 = or i64 %14, 1
%22 = fadd <2 x double> %19, <double 2.000000e+00, double 2.000000e+00>
%23 = getelementptr inbounds double, double* %10, i64 %21
%24 = bitcast double* %23 to <4 x double>*
%25 = shufflevector <2 x double> %20, <2 x double> %22, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %25, <4 x double>* %24
%26 = shl nsw i64 %13, 2
%27 = getelementptr inbounds double, double* %1, i64 %26
%28 = bitcast double* %27 to <8 x double>*
%29 = load <8 x double>, <8 x double>* %28
%30 = shufflevector <8 x double> %29, <8 x double> poison, <2 x i32> <i32 0, i32 4>
%31 = shufflevector <8 x double> %29, <8 x double> poison, <2 x i32> <i32 1, i32 5>
%32 = shufflevector <8 x double> %29, <8 x double> poison, <2 x i32> <i32 2, i32 6>
%33 = shufflevector <8 x double> %29, <8 x double> poison, <2 x i32> <i32 3, i32 7>
%34 = fadd <2 x double> %30, <double 3.000000e+00, double 3.000000e+00>
%35 = fadd <2 x double> %31, <double 4.000000e+00, double 4.000000e+00>
%36 = fadd <2 x double> %32, <double 5.000000e+00, double 5.000000e+00>
%37 = or i64 %26, 3
%38 = fadd <2 x double> %33, <double 6.000000e+00, double 6.000000e+00>
%39 = getelementptr inbounds double, double* %11, i64 %37
%40 = bitcast double* %39 to <8 x double>*
%41 = shufflevector <2 x double> %34, <2 x double> %35, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%42 = shufflevector <2 x double> %36, <2 x double> %38, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%43 = shufflevector <4 x double> %41, <4 x double> %42, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5, i32 7>
store <8 x double> %43, <8 x double>* %40
%44 = add nuw i64 %13, 2
%45 = icmp eq i64 %44, %9
br i1 %45, label %46, label %12
46: ; preds = %12
%47 = icmp eq i64 %9, %6
br i1 %47, label %50, label %48
48: ; preds = %5, %46
%49 = phi i64 [ 0, %5 ], [ %9, %46 ]
br label %51
50: ; preds = %51, %46, %3
ret void
51: ; preds = %48, %51
%52 = phi i64 [ %71, %51 ], [ %49, %48 ]
%53 = shl nuw nsw i64 %52, 1
%54 = getelementptr inbounds double, double* %0, i64 %53
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = fadd <2 x double> %56, <double 1.000000e+00, double 2.000000e+00>
%58 = bitcast double* %54 to <2 x double>*
store <2 x double> %57, <2 x double>* %58
%59 = shl nsw i64 %52, 2
%60 = getelementptr inbounds double, double* %1, i64 %59
%61 = bitcast double* %60 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = fadd <2 x double> %62, <double 3.000000e+00, double 4.000000e+00>
%64 = bitcast double* %60 to <2 x double>*
store <2 x double> %63, <2 x double>* %64
%65 = or i64 %59, 2
%66 = getelementptr inbounds double, double* %1, i64 %65
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = fadd <2 x double> %68, <double 5.000000e+00, double 6.000000e+00>
%70 = bitcast double* %66 to <2 x double>*
store <2 x double> %69, <2 x double>* %70
%71 = add nuw nsw i64 %52, 1
%72 = icmp eq i64 %71, %6
br i1 %72, label %50, label %51
}