• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -licm -enable-mssa-loop-dependency=true %s | FileCheck %s
2@v_1 = global i8 0, align 1
3@v_2 =  global i8 0, align 1
4
5; CHECK-LABEL: @foo()
6; CHECK: for.cond:
7; CHECK-NOT: store
8; CHECK: for.body:
9; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
10; CHECK: store
11define void @foo() {
12entry:
13  br label %for.cond
14
15for.cond:                                         ; preds = %for.body, %entry
16  %0 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
17  %cmp = icmp slt i16 %0, 1
18  br i1 %cmp, label %for.body, label %for.end
19
20for.body:                                         ; preds = %for.cond
21  call void @llvm.memcpy.p0i8.p0i8.i64(i8* @v_1, i8 * @v_2, i64 1, i1 false)
22  store i8 1, i8 * @v_2, align 1
23  %inc = add nsw i16 %0, 1
24  br label %for.cond
25
26for.end:                                          ; preds = %for.cond
27  ret void
28}
29
30; Function Attrs: argmemonly nounwind willreturn
31declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8 * noalias nocapture readonly, i64, i1 immarg) #2
32
33attributes #2 = { argmemonly nounwind willreturn }
34
35