1; RUN: opt -loop-idiom < %s -S | FileCheck %s
2; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,loop(loop-idiom)' < %s -S | FileCheck %s
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
6%struct.bigBlock_t = type { [256 x <4 x float>] }
7
8; CHECK-LABEL: @test(
9; CHECK-NOT: llvm.memset
10define void @test(%struct.bigBlock_t* %p) {
11entry:
12  %0 = getelementptr inbounds %struct.bigBlock_t, %struct.bigBlock_t* %p, i64 0, i32 0, i64 0, i64 0
13  br label %for.body
14
15for.body:                                         ; preds = %entry, %for.body
16  %index.02 = phi i32 [ 0, %entry ], [ %add, %for.body ]
17  %dst.01 = phi float* [ %0, %entry ], [ %add.ptr2, %for.body ]
18  %cast.i5 = bitcast float* %dst.01 to <4 x float>*
19  store <4 x float> zeroinitializer, <4 x float>* %cast.i5, align 16, !nontemporal !0
20  %add.ptr1 = getelementptr inbounds float, float* %dst.01, i64 4
21  %cast.i = bitcast float* %add.ptr1 to <4 x float>*
22  store <4 x float> zeroinitializer, <4 x float>* %cast.i, align 16, !nontemporal !0
23  %add.ptr2 = getelementptr inbounds float, float* %dst.01, i64 8
24  %add = add nuw nsw i32 %index.02, 32
25  %cmp = icmp ult i32 %add, 4096
26  br i1 %cmp, label %for.body, label %for.end
27
28for.end:                                          ; preds = %for.body
29  ret void
30}
31
32!0 = !{i32 1}
33