void mv3x3(double *restrict a, double *restrict v, double *restrict r) {
  double *pr;
  pr = r;
  *pr++ = *a++ * *v;
  *pr++ = *a++ * *v;
  *pr++ = *a++ * *v++;
  pr = r;
  *pr++ += *a++ * *v;
  *pr++ += *a++ * *v;
  *pr++ += *a++ * *v++;
  pr = r;
  *pr++ += *a++ * *v;
  *pr++ += *a++ * *v;
  *pr++ += *a++ * *v++;
}


x86 assembly (clang, -O0):
<mv3x3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mulsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mv3x3>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movupd (%rdi),%xmm3
mulpd  %xmm2,%xmm3
movupd 0x18(%rdi),%xmm2
mulsd  0x10(%rdi),%xmm0
movupd 0x30(%rdi),%xmm4
movapd %xmm1,%xmm5
unpcklpd %xmm1,%xmm5
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
mulsd  0x28(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsi),%xmm0
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm4,%xmm2
addpd  %xmm5,%xmm2
movupd %xmm2,(%rdx)
mulsd  0x40(%rdi),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @mv3x3(double* noalias %0, double* noalias %1, double* noalias %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %6
store double* %8, double** %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i32 1
store double* %10, double** %4
%11 = load double, double* %9
%12 = load double*, double** %5
%13 = load double, double* %12
%14 = fmul double %11, %13
%15 = load double*, double** %7
%16 = getelementptr inbounds double, double* %15, i32 1
store double* %16, double** %7
store double %14, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i32 1
store double* %18, double** %4
%19 = load double, double* %17
%20 = load double*, double** %5
%21 = load double, double* %20
%22 = fmul double %19, %21
%23 = load double*, double** %7
%24 = getelementptr inbounds double, double* %23, i32 1
store double* %24, double** %7
store double %22, double* %23
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i32 1
store double* %26, double** %4
%27 = load double, double* %25
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i32 1
store double* %29, double** %5
%30 = load double, double* %28
%31 = fmul double %27, %30
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i32 1
store double* %33, double** %7
store double %31, double* %32
%34 = load double*, double** %6
store double* %34, double** %7
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i32 1
store double* %36, double** %4
%37 = load double, double* %35
%38 = load double*, double** %5
%39 = load double, double* %38
%40 = load double*, double** %7
%41 = getelementptr inbounds double, double* %40, i32 1
store double* %41, double** %7
%42 = load double, double* %40
%43 = call double @llvm.fmuladd.f64(double %37, double %39, double %42)
store double %43, double* %40
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i32 1
store double* %45, double** %4
%46 = load double, double* %44
%47 = load double*, double** %5
%48 = load double, double* %47
%49 = load double*, double** %7
%50 = getelementptr inbounds double, double* %49, i32 1
store double* %50, double** %7
%51 = load double, double* %49
%52 = call double @llvm.fmuladd.f64(double %46, double %48, double %51)
store double %52, double* %49
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i32 1
store double* %54, double** %4
%55 = load double, double* %53
%56 = load double*, double** %5
%57 = getelementptr inbounds double, double* %56, i32 1
store double* %57, double** %5
%58 = load double, double* %56
%59 = load double*, double** %7
%60 = getelementptr inbounds double, double* %59, i32 1
store double* %60, double** %7
%61 = load double, double* %59
%62 = call double @llvm.fmuladd.f64(double %55, double %58, double %61)
store double %62, double* %59
%63 = load double*, double** %6
store double* %63, double** %7
%64 = load double*, double** %4
%65 = getelementptr inbounds double, double* %64, i32 1
store double* %65, double** %4
%66 = load double, double* %64
%67 = load double*, double** %5
%68 = load double, double* %67
%69 = load double*, double** %7
%70 = getelementptr inbounds double, double* %69, i32 1
store double* %70, double** %7
%71 = load double, double* %69
%72 = call double @llvm.fmuladd.f64(double %66, double %68, double %71)
store double %72, double* %69
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i32 1
store double* %74, double** %4
%75 = load double, double* %73
%76 = load double*, double** %5
%77 = load double, double* %76
%78 = load double*, double** %7
%79 = getelementptr inbounds double, double* %78, i32 1
store double* %79, double** %7
%80 = load double, double* %78
%81 = call double @llvm.fmuladd.f64(double %75, double %77, double %80)
store double %81, double* %78
%82 = load double*, double** %4
%83 = getelementptr inbounds double, double* %82, i32 1
store double* %83, double** %4
%84 = load double, double* %82
%85 = load double*, double** %5
%86 = getelementptr inbounds double, double* %85, i32 1
store double* %86, double** %5
%87 = load double, double* %85
%88 = load double*, double** %7
%89 = getelementptr inbounds double, double* %88, i32 1
store double* %89, double** %7
%90 = load double, double* %88
%91 = call double @llvm.fmuladd.f64(double %84, double %87, double %90)
store double %91, double* %88
ret void
}

LLVM IR (-O2):
define void @mv3x3(double* noalias nocapture %0, double* noalias nocapture %1, double* noalias nocapture %2) {
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = bitcast double* %0 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = insertelement <2 x double> poison, double %4, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
%10 = fmul <2 x double> %9, %7
%11 = getelementptr inbounds double, double* %2, i64 2
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = load double, double* %5
%14 = getelementptr inbounds double, double* %1, i64 1
%15 = fmul double %4, %13
%16 = load double, double* %14
%17 = getelementptr inbounds double, double* %0, i64 5
%18 = bitcast double* %12 to <2 x double>*
%19 = load <2 x double>, <2 x double>* %18
%20 = insertelement <2 x double> poison, double %16, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %21, <2 x double> %10)
%23 = getelementptr inbounds double, double* %0, i64 6
%24 = load double, double* %17
%25 = getelementptr inbounds double, double* %1, i64 2
%26 = tail call double @llvm.fmuladd.f64(double %24, double %16, double %15)
%27 = load double, double* %25
%28 = getelementptr inbounds double, double* %0, i64 8
%29 = bitcast double* %23 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = insertelement <2 x double> poison, double %27, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %30, <2 x double> %32, <2 x double> %22)
%34 = bitcast double* %2 to <2 x double>*
store <2 x double> %33, <2 x double>* %34
%35 = load double, double* %28
%36 = tail call double @llvm.fmuladd.f64(double %35, double %27, double %26)
store double %36, double* %11
ret void
}