void kernel_dtrmv_u_n_2_lib4(int kmax, double *A, double *x, double *y,
                             int alg) {
  if (kmax <= 0)
    return;
  __builtin_prefetch(A);
  __builtin_prefetch(A + 8);
  const int lda = 4;
  int k;
  double x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0;
  __builtin_prefetch(A + 4 * lda);
  __builtin_prefetch(A + 4 * lda + 8);
  x_0 = x[0];
  x_1 = x[1];
  y_0 += A[0 + lda * 0] * x_0;
  y_0 += A[0 + lda * 1] * x_1;
  y_1 += A[1 + lda * 1] * x_1;
  A += 2 * lda;
  x += 2;
  k = 2;
  for (; k < kmax - 3; k += 4) {
    __builtin_prefetch(A + 4 * lda);
    __builtin_prefetch(A + 4 * lda + 8);
    x_0 = x[0];
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[1 + lda * 0] * x_0;
    y_0 += A[0 + lda * 1] * x_1;
    y_1 += A[1 + lda * 1] * x_1;
    y_0 += A[0 + lda * 2] * x_2;
    y_1 += A[1 + lda * 2] * x_2;
    y_0 += A[0 + lda * 3] * x_3;
    y_1 += A[1 + lda * 3] * x_3;
    A += 4 * lda;
    x += 4;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[1 + lda * 0] * x_0;
    A += 1 * lda;
    x += 1;
  }
  if (alg == 0) {
    y[0] = y_0;
    y[1] = y_1;
  } else if (alg == 1) {
    y[0] += y_0;
    y[1] += y_1;
  } else {
    y[0] -= y_0;
    y[1] -= y_1;
  }
}


x86 assembly (clang, -O0):
<kernel_dtrmv_u_n_2_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1126 <kernel_dtrmv_u_n_2_lib4+0x26>
jmp    14a4 <kernel_dtrmv_u_n_2_lib4+0x3a4>
mov    -0x10(%rbp),%rax
prefetcht0 (%rax)
mov    -0x10(%rbp),%rax
add    $0x40,%rax
prefetcht0 (%rax)
movl   $0x4,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
add    $0x80,%rax
prefetcht0 (%rax)
mov    -0x10(%rbp),%rax
add    $0x80,%rax
add    $0x40,%rax
prefetcht0 (%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1393 <kernel_dtrmv_u_n_2_lib4+0x293>
mov    -0x10(%rbp),%rax
add    $0x80,%rax
prefetcht0 (%rax)
mov    -0x10(%rbp),%rax
add    $0x80,%rax
add    $0x40,%rax
prefetcht0 (%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x2c(%rbp)
jmp    1206 <kernel_dtrmv_u_n_2_lib4+0x106>
jmp    1398 <kernel_dtrmv_u_n_2_lib4+0x298>
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1416 <kernel_dtrmv_u_n_2_lib4+0x316>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1398 <kernel_dtrmv_u_n_2_lib4+0x298>
cmpl   $0x0,-0x24(%rbp)
jne    1440 <kernel_dtrmv_u_n_2_lib4+0x340>
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
jmp    14a4 <kernel_dtrmv_u_n_2_lib4+0x3a4>
cmpl   $0x1,-0x24(%rbp)
jne    1473 <kernel_dtrmv_u_n_2_lib4+0x373>
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
jmp    149f <kernel_dtrmv_u_n_2_lib4+0x39f>
movsd  -0x58(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    14a4 <kernel_dtrmv_u_n_2_lib4+0x3a4>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dtrmv_u_n_2_lib4>:
test   %edi,%edi
jle    12b9 <kernel_dtrmv_u_n_2_lib4+0x1b9>
prefetcht0 (%rsi)
prefetcht0 0x40(%rsi)
prefetcht0 0x80(%rsi)
prefetcht0 0xc0(%rsi)
movsd  (%rsi),%xmm0
mulsd  (%rdx),%xmm0
lea    0x40(%rsi),%rax
xorpd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movupd 0x20(%rsi),%xmm0
movsd  0x8(%rdx),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm0,%xmm2
movq   %xmm1,%xmm0
addpd  %xmm2,%xmm0
add    $0x10,%rdx
mov    $0x2,%r9d
cmp    $0x6,%edi
jb     11f8 <kernel_dtrmv_u_n_2_lib4+0xf8>
lea    -0x3(%rdi),%r10d
lea    -0x6(%rdi),%r9d
and    $0xfffffffc,%r9d
mov    $0x2,%esi
nop
prefetcht0 0x80(%rax)
prefetcht0 0xc0(%rax)
movupd (%rax),%xmm3
movupd 0x20(%rax),%xmm4
movupd 0x40(%rax),%xmm5
movupd 0x60(%rax),%xmm8
add    $0x80,%rax
movsd  (%rdx),%xmm7
movsd  0x8(%rdx),%xmm6
movsd  0x10(%rdx),%xmm2
movsd  0x18(%rdx),%xmm1
unpcklpd %xmm7,%xmm7
mulpd  %xmm3,%xmm7
addpd  %xmm0,%xmm7
unpcklpd %xmm6,%xmm6
mulpd  %xmm4,%xmm6
addpd  %xmm7,%xmm6
unpcklpd %xmm2,%xmm2
mulpd  %xmm5,%xmm2
addpd  %xmm6,%xmm2
unpcklpd %xmm1,%xmm1
mulpd  %xmm8,%xmm1
movapd %xmm1,%xmm0
addpd  %xmm2,%xmm0
add    $0x20,%rdx
add    $0x4,%esi
cmp    %r10d,%esi
jl     1170 <kernel_dtrmv_u_n_2_lib4+0x70>
addpd  %xmm2,%xmm1
add    $0x6,%r9d
movapd %xmm1,%xmm0
cmp    %edi,%r9d
jge    1215 <kernel_dtrmv_u_n_2_lib4+0x115>
mov    %edi,%esi
sub    %r9d,%esi
mov    %r9d,%r10d
not    %r10d
test   $0x1,%sil
jne    121b <kernel_dtrmv_u_n_2_lib4+0x11b>
add    %edi,%r10d
jne    1244 <kernel_dtrmv_u_n_2_lib4+0x144>
jmp    1290 <kernel_dtrmv_u_n_2_lib4+0x190>
movapd %xmm0,%xmm1
jmp    1290 <kernel_dtrmv_u_n_2_lib4+0x190>
movupd (%rax),%xmm2
movsd  (%rdx),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
add    $0x20,%rax
add    $0x8,%rdx
add    $0x1,%r9d
movapd %xmm1,%xmm0
add    %edi,%r10d
je     1290 <kernel_dtrmv_u_n_2_lib4+0x190>
sub    %r9d,%edi
xor    %esi,%esi
nopl   0x0(%rax)
movsd  (%rdx,%rsi,8),%xmm3
movsd  0x8(%rdx,%rsi,8),%xmm1
unpcklpd %xmm3,%xmm3
movupd (%rax),%xmm2
mulpd  %xmm3,%xmm2
addpd  %xmm0,%xmm2
movupd 0x20(%rax),%xmm0
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
addpd  %xmm2,%xmm0
add    $0x2,%rsi
add    $0x40,%rax
cmp    %esi,%edi
jne    1250 <kernel_dtrmv_u_n_2_lib4+0x150>
addpd  %xmm2,%xmm1
cmp    $0x1,%r8d
je     12a0 <kernel_dtrmv_u_n_2_lib4+0x1a0>
test   %r8d,%r8d
jne    12ad <kernel_dtrmv_u_n_2_lib4+0x1ad>
movupd %xmm1,(%rcx)
ret
movupd (%rcx),%xmm0
addpd  %xmm0,%xmm1
movupd %xmm1,(%rcx)
ret
movupd (%rcx),%xmm0
subpd  %xmm1,%xmm0
movupd %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @kernel_dtrmv_u_n_2_lib4(i32 %0, double* %1, double* %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%19 = load i32, i32* %6
%20 = icmp sle i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %5
br label %207
22: ; preds = %5
%23 = load double*, double** %7
%24 = bitcast double* %23 to i8*
%25 = load double*, double** %7
%26 = getelementptr inbounds double, double* %25, i64 8
%27 = bitcast double* %26 to i8*
store i32 4, i32* %11
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
%28 = load double*, double** %7
%29 = getelementptr inbounds double, double* %28, i64 16
%30 = bitcast double* %29 to i8*
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 16
%33 = getelementptr inbounds double, double* %32, i64 8
%34 = bitcast double* %33 to i8*
%35 = load double*, double** %8
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
store double %37, double* %13
%38 = load double*, double** %8
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
store double %40, double* %14
%41 = load double*, double** %7
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = load double, double* %13
%45 = load double, double* %17
%46 = call double @llvm.fmuladd.f64(double %43, double %44, double %45)
store double %46, double* %17
%47 = load double*, double** %7
%48 = getelementptr inbounds double, double* %47, i64 4
%49 = load double, double* %48
%50 = load double, double* %14
%51 = load double, double* %17
%52 = call double @llvm.fmuladd.f64(double %49, double %50, double %51)
store double %52, double* %17
%53 = load double*, double** %7
%54 = getelementptr inbounds double, double* %53, i64 5
%55 = load double, double* %54
%56 = load double, double* %14
%57 = load double, double* %18
%58 = call double @llvm.fmuladd.f64(double %55, double %56, double %57)
store double %58, double* %18
%59 = load double*, double** %7
%60 = getelementptr inbounds double, double* %59, i64 8
store double* %60, double** %7
%61 = load double*, double** %8
%62 = getelementptr inbounds double, double* %61, i64 2
store double* %62, double** %8
store i32 2, i32* %12
br label %63
63: ; preds = %140, %22
%64 = load i32, i32* %12
%65 = load i32, i32* %6
%66 = sub nsw i32 %65, 3
%67 = icmp slt i32 %64, %66
br i1 %67, label %68, label %143
68: ; preds = %63
%69 = load double*, double** %7
%70 = getelementptr inbounds double, double* %69, i64 16
%71 = bitcast double* %70 to i8*
%72 = load double*, double** %7
%73 = getelementptr inbounds double, double* %72, i64 16
%74 = getelementptr inbounds double, double* %73, i64 8
%75 = bitcast double* %74 to i8*
%76 = load double*, double** %8
%77 = getelementptr inbounds double, double* %76, i64 0
%78 = load double, double* %77
store double %78, double* %13
%79 = load double*, double** %8
%80 = getelementptr inbounds double, double* %79, i64 1
%81 = load double, double* %80
store double %81, double* %14
%82 = load double*, double** %8
%83 = getelementptr inbounds double, double* %82, i64 2
%84 = load double, double* %83
store double %84, double* %15
%85 = load double*, double** %8
%86 = getelementptr inbounds double, double* %85, i64 3
%87 = load double, double* %86
store double %87, double* %16
%88 = load double*, double** %7
%89 = getelementptr inbounds double, double* %88, i64 0
%90 = load double, double* %89
%91 = load double, double* %13
%92 = load double, double* %17
%93 = call double @llvm.fmuladd.f64(double %90, double %91, double %92)
store double %93, double* %17
%94 = load double*, double** %7
%95 = getelementptr inbounds double, double* %94, i64 1
%96 = load double, double* %95
%97 = load double, double* %13
%98 = load double, double* %18
%99 = call double @llvm.fmuladd.f64(double %96, double %97, double %98)
store double %99, double* %18
%100 = load double*, double** %7
%101 = getelementptr inbounds double, double* %100, i64 4
%102 = load double, double* %101
%103 = load double, double* %14
%104 = load double, double* %17
%105 = call double @llvm.fmuladd.f64(double %102, double %103, double %104)
store double %105, double* %17
%106 = load double*, double** %7
%107 = getelementptr inbounds double, double* %106, i64 5
%108 = load double, double* %107
%109 = load double, double* %14
%110 = load double, double* %18
%111 = call double @llvm.fmuladd.f64(double %108, double %109, double %110)
store double %111, double* %18
%112 = load double*, double** %7
%113 = getelementptr inbounds double, double* %112, i64 8
%114 = load double, double* %113
%115 = load double, double* %15
%116 = load double, double* %17
%117 = call double @llvm.fmuladd.f64(double %114, double %115, double %116)
store double %117, double* %17
%118 = load double*, double** %7
%119 = getelementptr inbounds double, double* %118, i64 9
%120 = load double, double* %119
%121 = load double, double* %15
%122 = load double, double* %18
%123 = call double @llvm.fmuladd.f64(double %120, double %121, double %122)
store double %123, double* %18
%124 = load double*, double** %7
%125 = getelementptr inbounds double, double* %124, i64 12
%126 = load double, double* %125
%127 = load double, double* %16
%128 = load double, double* %17
%129 = call double @llvm.fmuladd.f64(double %126, double %127, double %128)
store double %129, double* %17
%130 = load double*, double** %7
%131 = getelementptr inbounds double, double* %130, i64 13
%132 = load double, double* %131
%133 = load double, double* %16
%134 = load double, double* %18
%135 = call double @llvm.fmuladd.f64(double %132, double %133, double %134)
store double %135, double* %18
%136 = load double*, double** %7
%137 = getelementptr inbounds double, double* %136, i64 16
store double* %137, double** %7
%138 = load double*, double** %8
%139 = getelementptr inbounds double, double* %138, i64 4
store double* %139, double** %8
br label %140
140: ; preds = %68
%141 = load i32, i32* %12
%142 = add nsw i32 %141, 4
store i32 %142, i32* %12
br label %63
143: ; preds = %63
br label %144
144: ; preds = %168, %143
%145 = load i32, i32* %12
%146 = load i32, i32* %6
%147 = icmp slt i32 %145, %146
br i1 %147, label %148, label %171
148: ; preds = %144
%149 = load double*, double** %8
%150 = getelementptr inbounds double, double* %149, i64 0
%151 = load double, double* %150
store double %151, double* %13
%152 = load double*, double** %7
%153 = getelementptr inbounds double, double* %152, i64 0
%154 = load double, double* %153
%155 = load double, double* %13
%156 = load double, double* %17
%157 = call double @llvm.fmuladd.f64(double %154, double %155, double %156)
store double %157, double* %17
%158 = load double*, double** %7
%159 = getelementptr inbounds double, double* %158, i64 1
%160 = load double, double* %159
%161 = load double, double* %13
%162 = load double, double* %18
%163 = call double @llvm.fmuladd.f64(double %160, double %161, double %162)
store double %163, double* %18
%164 = load double*, double** %7
%165 = getelementptr inbounds double, double* %164, i64 4
store double* %165, double** %7
%166 = load double*, double** %8
%167 = getelementptr inbounds double, double* %166, i64 1
store double* %167, double** %8
br label %168
168: ; preds = %148
%169 = load i32, i32* %12
%170 = add nsw i32 %169, 1
store i32 %170, i32* %12
br label %144
171: ; preds = %144
%172 = load i32, i32* %10
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %181
174: ; preds = %171
%175 = load double, double* %17
%176 = load double*, double** %9
%177 = getelementptr inbounds double, double* %176, i64 0
store double %175, double* %177
%178 = load double, double* %18
%179 = load double*, double** %9
%180 = getelementptr inbounds double, double* %179, i64 1
store double %178, double* %180
br label %207
181: ; preds = %171
%182 = load i32, i32* %10
%183 = icmp eq i32 %182, 1
br i1 %183, label %184, label %195
184: ; preds = %181
%185 = load double, double* %17
%186 = load double*, double** %9
%187 = getelementptr inbounds double, double* %186, i64 0
%188 = load double, double* %187
%189 = fadd double %188, %185
store double %189, double* %187
%190 = load double, double* %18
%191 = load double*, double** %9
%192 = getelementptr inbounds double, double* %191, i64 1
%193 = load double, double* %192
%194 = fadd double %193, %190
store double %194, double* %192
br label %206
195: ; preds = %181
%196 = load double, double* %17
%197 = load double*, double** %9
%198 = getelementptr inbounds double, double* %197, i64 0
%199 = load double, double* %198
%200 = fsub double %199, %196
store double %200, double* %198
%201 = load double, double* %18
%202 = load double*, double** %9
%203 = getelementptr inbounds double, double* %202, i64 1
%204 = load double, double* %203
%205 = fsub double %204, %201
store double %205, double* %203
br label %206
206: ; preds = %195, %184
br label %207
207: ; preds = %21, %206, %174
ret void
}

LLVM IR (-O2):
define void @kernel_dtrmv_u_n_2_lib4(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32 %4) {
%6 = icmp slt i32 %0, 1
br i1 %6, label %150, label %7
7: ; preds = %5
%8 = bitcast double* %1 to i8*
tail call void @llvm.prefetch.p0i8(i8* %8, i32 0, i32 3, i32 1)
%9 = getelementptr inbounds double, double* %1, i64 8
%10 = bitcast double* %9 to i8*
tail call void @llvm.prefetch.p0i8(i8* %10, i32 0, i32 3, i32 1)
%11 = getelementptr inbounds double, double* %1, i64 16
%12 = bitcast double* %11 to i8*
tail call void @llvm.prefetch.p0i8(i8* %12, i32 0, i32 3, i32 1)
%13 = getelementptr inbounds double, double* %1, i64 24
%14 = bitcast double* %13 to i8*
tail call void @llvm.prefetch.p0i8(i8* %14, i32 0, i32 3, i32 1)
%15 = load double, double* %2
%16 = getelementptr inbounds double, double* %2, i64 1
%17 = load double, double* %16
%18 = load double, double* %1
%19 = tail call double @llvm.fmuladd.f64(double %18, double %15, double 0.000000e+00)
%20 = getelementptr inbounds double, double* %1, i64 4
%21 = bitcast double* %20 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = insertelement <2 x double> poison, double %17, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = insertelement <2 x double> <double poison, double 0.000000e+00>, double %19, i64 0
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %22, <2 x double> %24, <2 x double> %25)
%27 = getelementptr inbounds double, double* %2, i64 2
%28 = add nsw i32 %0, -3
%29 = icmp ugt i32 %0, 5
br i1 %29, label %30, label %39
30: ; preds = %7
%31 = add nsw i32 %0, -6
%32 = and i32 %31, -4
br label %69
33: ; preds = %69
%34 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %86, <2 x double> %88, <2 x double> %73)
%35 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %92, <2 x double> %94, <2 x double> %34)
%36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %100, <2 x double> %35)
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %104, <2 x double> %106, <2 x double> %36)
%38 = add i32 %32, 6
br label %39
39: ; preds = %33, %7
%40 = phi i32 [ 2, %7 ], [ %38, %33 ]
%41 = phi double* [ %27, %7 ], [ %108, %33 ]
%42 = phi double* [ %9, %7 ], [ %74, %33 ]
%43 = phi <2 x double> [ %26, %7 ], [ %37, %33 ]
%44 = icmp slt i32 %40, %0
br i1 %44, label %45, label %136
45: ; preds = %39
%46 = sub i32 %0, %40
%47 = xor i32 %40, -1
%48 = and i32 %46, 1
%49 = icmp eq i32 %48, 0
br i1 %49, label %61, label %50
50: ; preds = %45
%51 = load double, double* %41
%52 = bitcast double* %42 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = insertelement <2 x double> poison, double %51, i64 0
%55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> zeroinitializer
%56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %53, <2 x double> %55, <2 x double> %43)
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %53, <2 x double> %55, <2 x double> %43)
%58 = getelementptr inbounds double, double* %42, i64 4
%59 = getelementptr inbounds double, double* %41, i64 1
%60 = add nuw nsw i32 %40, 1
br label %61
61: ; preds = %50, %45
%62 = phi <2 x double> [ undef, %45 ], [ %57, %50 ]
%63 = phi double* [ %42, %45 ], [ %58, %50 ]
%64 = phi double* [ %41, %45 ], [ %59, %50 ]
%65 = phi i32 [ %40, %45 ], [ %60, %50 ]
%66 = phi <2 x double> [ %43, %45 ], [ %56, %50 ]
%67 = sub i32 0, %0
%68 = icmp eq i32 %47, %67
br i1 %68, label %136, label %111
69: ; preds = %30, %69
%70 = phi double* [ %74, %69 ], [ %9, %30 ]
%71 = phi double* [ %108, %69 ], [ %27, %30 ]
%72 = phi i32 [ %109, %69 ], [ 2, %30 ]
%73 = phi <2 x double> [ %107, %69 ], [ %26, %30 ]
%74 = getelementptr inbounds double, double* %70, i64 16
%75 = bitcast double* %74 to i8*
tail call void @llvm.prefetch.p0i8(i8* %75, i32 0, i32 3, i32 1)
%76 = getelementptr inbounds double, double* %70, i64 24
%77 = bitcast double* %76 to i8*
tail call void @llvm.prefetch.p0i8(i8* %77, i32 0, i32 3, i32 1)
%78 = load double, double* %71
%79 = getelementptr inbounds double, double* %71, i64 1
%80 = load double, double* %79
%81 = getelementptr inbounds double, double* %71, i64 2
%82 = load double, double* %81
%83 = getelementptr inbounds double, double* %71, i64 3
%84 = load double, double* %83
%85 = bitcast double* %70 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = insertelement <2 x double> poison, double %78, i64 0
%88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> zeroinitializer
%89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %86, <2 x double> %88, <2 x double> %73)
%90 = getelementptr inbounds double, double* %70, i64 4
%91 = bitcast double* %90 to <2 x double>*
%92 = load <2 x double>, <2 x double>* %91
%93 = insertelement <2 x double> poison, double %80, i64 0
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
%95 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %92, <2 x double> %94, <2 x double> %89)
%96 = getelementptr inbounds double, double* %70, i64 8
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = insertelement <2 x double> poison, double %82, i64 0
%100 = shufflevector <2 x double> %99, <2 x double> poison, <2 x i32> zeroinitializer
%101 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %100, <2 x double> %95)
%102 = getelementptr inbounds double, double* %70, i64 12
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = insertelement <2 x double> poison, double %84, i64 0
%106 = shufflevector <2 x double> %105, <2 x double> poison, <2 x i32> zeroinitializer
%107 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %104, <2 x double> %106, <2 x double> %101)
%108 = getelementptr inbounds double, double* %71, i64 4
%109 = add nuw nsw i32 %72, 4
%110 = icmp slt i32 %109, %28
br i1 %110, label %69, label %33
111: ; preds = %61, %111
%112 = phi double* [ %130, %111 ], [ %63, %61 ]
%113 = phi double* [ %131, %111 ], [ %64, %61 ]
%114 = phi i32 [ %132, %111 ], [ %65, %61 ]
%115 = phi <2 x double> [ %129, %111 ], [ %66, %61 ]
%116 = load double, double* %113
%117 = bitcast double* %112 to <2 x double>*
%118 = load <2 x double>, <2 x double>* %117
%119 = insertelement <2 x double> poison, double %116, i64 0
%120 = shufflevector <2 x double> %119, <2 x double> poison, <2 x i32> zeroinitializer
%121 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %118, <2 x double> %120, <2 x double> %115)
%122 = getelementptr inbounds double, double* %112, i64 4
%123 = getelementptr inbounds double, double* %113, i64 1
%124 = load double, double* %123
%125 = bitcast double* %122 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = insertelement <2 x double> poison, double %124, i64 0
%128 = shufflevector <2 x double> %127, <2 x double> poison, <2 x i32> zeroinitializer
%129 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %126, <2 x double> %128, <2 x double> %121)
%130 = getelementptr inbounds double, double* %112, i64 8
%131 = getelementptr inbounds double, double* %113, i64 2
%132 = add nuw nsw i32 %114, 2
%133 = icmp eq i32 %132, %0
br i1 %133, label %134, label %111
134: ; preds = %111
%135 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %126, <2 x double> %128, <2 x double> %121)
br label %136
136: ; preds = %134, %61, %39
%137 = phi <2 x double> [ %43, %39 ], [ %62, %61 ], [ %135, %134 ]
switch i32 %4, label %145 [
i32 0, label %138
i32 1, label %140
]
138: ; preds = %136
%139 = bitcast double* %3 to <2 x double>*
store <2 x double> %137, <2 x double>* %139
br label %150
140: ; preds = %136
%141 = bitcast double* %3 to <2 x double>*
%142 = load <2 x double>, <2 x double>* %141
%143 = fadd <2 x double> %137, %142
%144 = bitcast double* %3 to <2 x double>*
store <2 x double> %143, <2 x double>* %144
br label %150
145: ; preds = %136
%146 = bitcast double* %3 to <2 x double>*
%147 = load <2 x double>, <2 x double>* %146
%148 = fsub <2 x double> %147, %137
%149 = bitcast double* %3 to <2 x double>*
store <2 x double> %148, <2 x double>* %149
br label %150
150: ; preds = %138, %145, %140, %5
ret void
}