1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -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(i64 addrspace(1)** %p) {
7 ; CHECK-LABEL: @illegal_memset(
9 ; CHECK-NEXT: [[P1:%.*]] = bitcast i64 addrspace(1)** [[P:%.*]] to i8*
10 ; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[P1]], i8 0, i64 8, i1 false)
11 ; CHECK-NEXT: [[GEP:%.*]] = getelementptr i64 addrspace(1)*, i64 addrspace(1)** [[P]], i64 1
12 ; CHECK-NEXT: store i64 addrspace(1)* null, i64 addrspace(1)** [[GEP]], align 8
13 ; CHECK-NEXT: ret void
16 %p1 = bitcast i64 addrspace(1)** %p to i8*
17 call void @llvm.memset.p0i8.i64(i8* %p1, i8 0, i64 8, i32 0, i1 false)
18 %gep = getelementptr i64 addrspace(1)*, i64 addrspace(1)** %p, i64 1
19 store i64 addrspace(1)* null, i64 addrspace(1)** %gep
23 define void @illegal_memcpy(<2 x i8 addrspace(1)*>* noalias align 16 %a,
24 ; CHECK-LABEL: @illegal_memcpy(
25 ; CHECK-NEXT: [[VAL:%.*]] = load <2 x i8 addrspace(1)*>, <2 x i8 addrspace(1)*>* [[A:%.*]], align 16
26 ; CHECK-NEXT: store <2 x i8 addrspace(1)*> [[VAL]], <2 x i8 addrspace(1)*>* [[B:%.*]], align 16
27 ; CHECK-NEXT: ret void
29 <2 x i8 addrspace(1)*>* noalias align 16 %b) {
30 %val = load <2 x i8 addrspace(1)*>, <2 x i8 addrspace(1)*>* %a, align 16
31 store <2 x i8 addrspace(1)*> %val, <2 x i8 addrspace(1)*>* %b, align 16
35 declare void @llvm.memset.p1i8.i64(i8 addrspace(1)*, i8, i64, i32, i1)
36 declare void @llvm.memset.p0i8.i64(i8*, i8, i64, i32, i1)