• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -O2 -S -enable-memcpyopt-memoryssa=0 | FileCheck %s
3; RUN: opt < %s -O2 -S -enable-memcpyopt-memoryssa=1 -verify-memoryssa | FileCheck %s
4
5; performCallSlotOptzn in MemCpy should not exchange the calls to
6; @llvm.lifetime.start and @llvm.memcpy.
7
8declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
9declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
10declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
11
12define void @_ZN4CordC2EOS_(i8* nocapture dereferenceable(16) %arg1) {
13; CHECK-LABEL: @_ZN4CordC2EOS_(
14; CHECK-NEXT:  bb:
15; CHECK-NEXT:    [[TMP_SROA_3_0_ARG1_SROA_RAW_IDX:%.*]] = getelementptr inbounds i8, i8* [[ARG1:%.*]], i64 7
16; CHECK-NEXT:    store i8 0, i8* [[TMP_SROA_3_0_ARG1_SROA_RAW_IDX]], align 1
17; CHECK-NEXT:    ret void
18;
19bb:
20  %tmp = alloca [8 x i8], align 8
21  %tmp5 = bitcast [8 x i8]* %tmp to i8*
22  call void @llvm.lifetime.start.p0i8(i64 16, i8* %tmp5)
23  %tmp10 = getelementptr inbounds i8, i8* %tmp5, i64 7
24  store i8 0, i8* %tmp10, align 1
25  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %arg1, i8* align 8 %tmp5, i64 16, i1 false)
26  call void @llvm.lifetime.end.p0i8(i64 16, i8* %tmp5)
27  ret void
28}
29
30attributes #1 = { argmemonly nounwind }
31