void __attribute__((no)) Foo(int *ary) {
  int ix;
#pragma acc parallel num_workers(32) vector_length(32) copyout(ary [0:N])
  {
#pragma acc loop worker vector
    for (unsigned ix = 0; ix < (32 * 32 * 32 + 17); ix++) {
      ary[ix] = ix;
    }
  }
}


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8011,-0x10(%rbp)
jae    1137 <Foo+0x37>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <Foo+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Foo>:
movdqa 0xef8(%rip),%xmm0
mov    $0x14,%eax
movdqa 0xefa(%rip),%xmm8
movdqa 0xf02(%rip),%xmm2
movdqa 0xf0a(%rip),%xmm3
movdqa 0xf12(%rip),%xmm4
movdqa 0xf1a(%rip),%xmm5
movdqa 0xf22(%rip),%xmm6
xchg   %ax,%ax
movdqa %xmm0,%xmm7
paddd  %xmm8,%xmm7
movdqu %xmm0,-0x50(%rdi,%rax,4)
movdqu %xmm7,-0x40(%rdi,%rax,4)
movdqa %xmm0,%xmm7
paddd  %xmm2,%xmm7
movdqa %xmm0,%xmm1
paddd  %xmm3,%xmm1
movdqu %xmm7,-0x30(%rdi,%rax,4)
movdqu %xmm1,-0x20(%rdi,%rax,4)
movdqa %xmm0,%xmm1
paddd  %xmm4,%xmm1
movdqa %xmm0,%xmm7
paddd  %xmm5,%xmm7
movdqu %xmm1,-0x10(%rdi,%rax,4)
movdqu %xmm7,(%rdi,%rax,4)
paddd  %xmm6,%xmm0
add    $0x18,%rax
cmp    $0x8024,%rax
jne    1140 <Foo+0x40>
movl   $0x8010,0x20040(%rdi)
ret

LLVM IR (-O0):
define void @Foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = icmp ult i32 %6, 32785
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Foo(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %24, %2 ]
%4 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %1 ], [ %25, %2 ]
%5 = add <4 x i32> %4, <i32 4, i32 4, i32 4, i32 4>
%6 = getelementptr inbounds i32, i32* %0, i64 %3
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %6, i64 4
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %9
%10 = add nuw nsw i64 %3, 8
%11 = add <4 x i32> %4, <i32 8, i32 8, i32 8, i32 8>
%12 = add <4 x i32> %4, <i32 12, i32 12, i32 12, i32 12>
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %14
%15 = getelementptr inbounds i32, i32* %13, i64 4
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %12, <4 x i32>* %16
%17 = add nuw nsw i64 %3, 16
%18 = add <4 x i32> %4, <i32 16, i32 16, i32 16, i32 16>
%19 = add <4 x i32> %4, <i32 20, i32 20, i32 20, i32 20>
%20 = getelementptr inbounds i32, i32* %0, i64 %17
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> %18, <4 x i32>* %21
%22 = getelementptr inbounds i32, i32* %20, i64 4
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> %19, <4 x i32>* %23
%24 = add nuw nsw i64 %3, 24
%25 = add <4 x i32> %4, <i32 24, i32 24, i32 24, i32 24>
%26 = icmp eq i64 %24, 32784
br i1 %26, label %27, label %2
27: ; preds = %2
%28 = getelementptr inbounds i32, i32* %0, i64 32784
store i32 32784, i32* %28
ret void
}