1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=memcpyopt -S < %s -verify-memoryssa | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128-ni:1"
6 define void @illegal_memset(ptr %p) {
7 ; CHECK-LABEL: @illegal_memset(
9 ; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[P:%.*]], i8 0, i64 8, i1 false)
10 ; CHECK-NEXT: [[GEP:%.*]] = getelementptr ptr addrspace(1), ptr [[P]], i64 1
11 ; CHECK-NEXT: store ptr addrspace(1) null, ptr [[GEP]], align 8
12 ; CHECK-NEXT: ret void
15 call void @llvm.memset.p0.i64(ptr %p, i8 0, i64 8, i32 0, i1 false)
16 %gep = getelementptr ptr addrspace(1), ptr %p, i64 1
17 store ptr addrspace(1) null, ptr %gep
21 define void @illegal_memcpy(ptr noalias align 16 %a,
22 ; CHECK-LABEL: @illegal_memcpy(
23 ; CHECK-NEXT: [[VAL:%.*]] = load <2 x ptr addrspace(1)>, ptr [[A:%.*]], align 16
24 ; CHECK-NEXT: store <2 x ptr addrspace(1)> [[VAL]], ptr [[B:%.*]], align 16
25 ; CHECK-NEXT: ret void
27 ptr noalias align 16 %b) {
28 %val = load <2 x ptr addrspace(1)>, ptr %a, align 16
29 store <2 x ptr addrspace(1)> %val, ptr %b, align 16
33 declare void @llvm.memset.p1.i64(ptr addrspace(1), i8, i64, i32, i1)
34 declare void @llvm.memset.p0.i64(ptr, i8, i64, i32, i1)