• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -S -memcpyopt | FileCheck %s
2target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
3
4; The resulting memset is only 4-byte aligned, despite containing
5; a 16-byte aligned store in the middle.
6
7; CHECK: call void @llvm.memset.p0i8.i64(i8* {{.*}}, i8 0, i64 16, i32 4, i1 false)
8
9define void @foo(i32* %p) {
10  %a0 = getelementptr i32* %p, i64 0
11  store i32 0, i32* %a0, align 4
12  %a1 = getelementptr i32* %p, i64 1
13  store i32 0, i32* %a1, align 16
14  %a2 = getelementptr i32* %p, i64 2
15  store i32 0, i32* %a2, align 4
16  %a3 = getelementptr i32* %p, i64 3
17  store i32 0, i32* %a3, align 4
18  ret void
19}
20