void test_double(double *data) {
#pragma omp simd
  for (int i = 0; i < 256 / sizeof(double); ++i)
    data[i] = 3.0;
}


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1140 <test_double+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <test_double+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xf0(%rdi)
ret

LLVM IR (-O0):
define void @test_double(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 32
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load double*, double** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
store double 3.000000e+00, double* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test_double(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %6
%7 = getelementptr inbounds double, double* %0, i64 6
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 8
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %10
%11 = getelementptr inbounds double, double* %0, i64 10
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %12
%13 = getelementptr inbounds double, double* %0, i64 12
%14 = bitcast double* %13 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %14
%15 = getelementptr inbounds double, double* %0, i64 14
%16 = bitcast double* %15 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %16
%17 = getelementptr inbounds double, double* %0, i64 16
%18 = bitcast double* %17 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %18
%19 = getelementptr inbounds double, double* %0, i64 18
%20 = bitcast double* %19 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %20
%21 = getelementptr inbounds double, double* %0, i64 20
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %22
%23 = getelementptr inbounds double, double* %0, i64 22
%24 = bitcast double* %23 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %24
%25 = getelementptr inbounds double, double* %0, i64 24
%26 = bitcast double* %25 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %26
%27 = getelementptr inbounds double, double* %0, i64 26
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %28
%29 = getelementptr inbounds double, double* %0, i64 28
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %30
%31 = getelementptr inbounds double, double* %0, i64 30
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %32
ret void
}