void mtv3x3(double *restrict a, double *restrict v, double *restrict r) {
  double *pv = v;
  *r = *a++ * *pv++;
  *r += *a++ * *pv++;
  *r++ += *a++ * *pv;
  pv = v;
  *r = *a++ * *pv++;
  *r += *a++ * *pv++;
  *r++ += *a++ * *pv;
  pv = v;
  *r = *a++ * *pv++;
  *r += *a++ * *pv++;
  *r += *a * *pv;
}


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

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

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

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