1; RUN: opt -mattr=+avx512f --loop-vectorize -S < %s | llc -mattr=+avx512f | FileCheck %s
2
3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-apple-macosx10.9.0"
5
6; Verify that we generate 512-bit wide vectors for a basic integer memset
7; loop.
8
9; CHECK-LABEL: f:
10; CHECK: vmovdqu32 %zmm{{.}}, (
11; CHECK-NOT: %ymm
12
13define void @f(i32* %a, i32 %n) {
14entry:
15  %cmp4 = icmp sgt i32 %n, 0
16  br i1 %cmp4, label %for.body.preheader, label %for.end
17
18for.body.preheader:                               ; preds = %entry
19  br label %for.body
20
21for.body:                                         ; preds = %for.body.preheader, %for.body
22  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
23  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
24  store i32 %n, i32* %arrayidx, align 4
25  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
26  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
27  %exitcond = icmp eq i32 %lftr.wideiv, %n
28  br i1 %exitcond, label %for.end.loopexit, label %for.body
29
30for.end.loopexit:                                 ; preds = %for.body
31  br label %for.end
32
33for.end:                                          ; preds = %for.end.loopexit, %entry
34  ret void
35}
36