1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=memcpyopt -S -verify-memoryssa | FileCheck %s
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
5 target triple = "i686-apple-darwin9"
7 %0 = type { x86_fp80, x86_fp80 }
9 define void @ccosl(ptr noalias writable sret(%0) %agg.result, ptr byval(%0) align 8 %z) nounwind {
10 ; CHECK-LABEL: @ccosl(
12 ; CHECK-NEXT: [[IZ:%.*]] = alloca [[TMP0:%.*]], align 16
13 ; CHECK-NEXT: [[MEMTMP:%.*]] = alloca [[TMP0]], align 16
14 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr [[TMP0]], ptr [[Z:%.*]], i32 0, i32 1
15 ; CHECK-NEXT: [[TMP2:%.*]] = load x86_fp80, ptr [[TMP1]], align 16
16 ; CHECK-NEXT: [[TMP3:%.*]] = fsub x86_fp80 0xK80000000000000000000, [[TMP2]]
17 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr [[TMP0]], ptr [[IZ]], i32 0, i32 1
18 ; CHECK-NEXT: [[TMP8:%.*]] = load x86_fp80, ptr [[Z]], align 16
19 ; CHECK-NEXT: store x86_fp80 [[TMP3]], ptr [[IZ]], align 16
20 ; CHECK-NEXT: store x86_fp80 [[TMP8]], ptr [[TMP4]], align 16
21 ; CHECK-NEXT: call void @ccoshl(ptr noalias sret([[TMP0]]) [[AGG_RESULT:%.*]], ptr byval([[TMP0]]) align 8 [[IZ]]) #[[ATTR0:[0-9]+]]
22 ; CHECK-NEXT: ret void
26 %memtmp = alloca %0, align 16
27 %tmp1 = getelementptr %0, ptr %z, i32 0, i32 1
28 %tmp2 = load x86_fp80, ptr %tmp1, align 16
29 %tmp3 = fsub x86_fp80 0xK80000000000000000000, %tmp2
30 %tmp4 = getelementptr %0, ptr %iz, i32 0, i32 1
31 %tmp8 = load x86_fp80, ptr %z, align 16
32 store x86_fp80 %tmp3, ptr %iz, align 16
33 store x86_fp80 %tmp8, ptr %tmp4, align 16
34 call void @ccoshl(ptr noalias sret(%0) %memtmp, ptr byval(%0) align 8 %iz) nounwind
35 call void @llvm.memcpy.p0.p0.i32(ptr align 16 %agg.result, ptr align 16 %memtmp, i32 32, i1 false)
39 declare void @ccoshl(ptr noalias nocapture sret(%0), ptr byval(%0)) nounwind
41 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind