1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
5 define i32 @foo(ptr nocapture %perm, i32 %n) {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: movl %esi, %eax
9 ; CHECK-NEXT: movaps {{.*#+}} xmm0 = [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]
10 ; CHECK-NEXT: movl %esi, %ecx
11 ; CHECK-NEXT: andl $1, %ecx
12 ; CHECK-NEXT: movaps {{.*#+}} xmm1 = [2,3]
13 ; CHECK-NEXT: .p2align 4, 0x90
14 ; CHECK-NEXT: .LBB0_1: # %body
15 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
16 ; CHECK-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
17 ; CHECK-NEXT: movq -24(%rsp,%rcx,8), %rdx
18 ; CHECK-NEXT: movups %xmm0, (%rdi,%rdx,8)
19 ; CHECK-NEXT: testq %rdx, %rdx
20 ; CHECK-NEXT: movaps %xmm1, %xmm0
21 ; CHECK-NEXT: jne .LBB0_1
22 ; CHECK-NEXT: # %bb.2: # %exit
28 %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %entry ], [ <i64 2, i64 3>, %body ]
29 %l13 = extractelement <2 x i64> %vec.ind, i32 %n
30 %l14 = getelementptr inbounds i64, ptr %perm, i64 %l13
31 store <2 x i64> %vec.ind, ptr %l14, align 8
32 %niter.ncmp.3 = icmp eq i64 %l13, 0
33 br i1 %niter.ncmp.3, label %exit, label %body