1; RUN: opt -basic-aa -loop-idiom < %s -S | FileCheck %s
2target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
3
4;; memcpy.atomic formation (atomic load & store) -- element size 2
5;;  Will not create call due to a max element size of 0
6define void @test1(i64 %Size) nounwind ssp {
7; CHECK-LABEL: @test1(
8; CHECK-NOT: call void @llvm.memcpy.element.unordered.atomic
9; CHECK: store
10; CHECK: ret void
11bb.nph:
12  %Base = alloca i16, i32 10000
13  %Dest = alloca i16, i32 10000
14  br label %for.body
15
16for.body:                                         ; preds = %bb.nph, %for.body
17  %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ]
18  %I.0.014 = getelementptr i16, i16* %Base, i64 %indvar
19  %DestI = getelementptr i16, i16* %Dest, i64 %indvar
20  %V = load atomic i16, i16* %I.0.014 unordered, align 2
21  store atomic i16 %V, i16* %DestI unordered, align 2
22  %indvar.next = add i64 %indvar, 1
23  %exitcond = icmp eq i64 %indvar.next, %Size
24  br i1 %exitcond, label %for.end, label %for.body
25
26for.end:                                          ; preds = %for.body, %entry
27  ret void
28}
29