void mvp3x3(const double *restrict a, const 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):
<mvp3x3>:
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
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)
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):
<mvp3x3>:
movupd (%rdx),%xmm1
movsd  (%rsi),%xmm2
movsd  0x8(%rsi),%xmm0
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
movupd (%rdi),%xmm4
mulpd  %xmm3,%xmm4
addpd  %xmm1,%xmm4
movupd 0x18(%rdi),%xmm1
mulsd  0x10(%rdi),%xmm2
addsd  0x10(%rdx),%xmm2
movupd 0x30(%rdi),%xmm3
movapd %xmm0,%xmm5
unpcklpd %xmm0,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm4,%xmm5
mulsd  0x28(%rdi),%xmm0
addsd  %xmm2,%xmm0
movsd  0x10(%rsi),%xmm1
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
mulpd  %xmm3,%xmm2
addpd  %xmm5,%xmm2
movupd %xmm2,(%rdx)
mulsd  0x40(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdx)
ret

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

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