1 ; RUN: opt -loop-idiom < %s -S | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
7 define void @test(i8* noalias nocapture %base, i64 %size) #1 {
9 %cmp3 = icmp eq i64 %size, 0
10 br i1 %cmp3, label %for.end, label %for.body.preheader
12 for.body.preheader: ; preds = %entry
15 for.body: ; preds = %for.body.preheader, %for.body
17 ; CHECK-NOT: llvm.memset
18 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
20 %arrayidx = getelementptr inbounds i8, i8* %base, i64 %indvars.iv
21 store i8 0, i8* %arrayidx, align 1
22 %indvars.iv.next = add i64 %indvars.iv, 1
23 %exitcond = icmp ne i64 %indvars.iv.next, %size
24 br i1 %exitcond, label %for.body, label %for.end.loopexit
26 for.end.loopexit: ; preds = %for.body
29 for.end: ; preds = %for.end.loopexit, %entry
33 attributes #1 = { uwtable }