]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll
Import LLVM, at r72732.
[FreeBSD/FreeBSD.git] / test / Transforms / MemCpyOpt / 2008-02-24-MultipleUseofSRet.ll
1 ; RUN: llvm-as < %s | opt -memcpyopt -dse | llvm-dis | grep {call.*initialize} | not grep memtmp
2 ; PR2077
3
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:32:32"
5 target triple = "i386-pc-linux-gnu"
6
7 define internal fastcc void @initialize({ x86_fp80, x86_fp80 }* noalias sret  %agg.result) nounwind  {
8 entry:
9         %agg.result.03 = getelementptr { x86_fp80, x86_fp80 }* %agg.result, i32 0, i32 0                ; <x86_fp80*> [#uses=1]
10         store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.03
11         %agg.result.15 = getelementptr { x86_fp80, x86_fp80 }* %agg.result, i32 0, i32 1                ; <x86_fp80*> [#uses=1]
12         store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.15
13         ret void
14 }
15
16 declare fastcc x86_fp80 @passed_uninitialized({ x86_fp80, x86_fp80 }* %x) nounwind
17
18 define fastcc void @badly_optimized() nounwind  {
19 entry:
20         %z = alloca { x86_fp80, x86_fp80 }              ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
21         %tmp = alloca { x86_fp80, x86_fp80 }            ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
22         %memtmp = alloca { x86_fp80, x86_fp80 }, align 8                ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
23         call fastcc void @initialize( { x86_fp80, x86_fp80 }* noalias sret  %memtmp )
24         %tmp1 = bitcast { x86_fp80, x86_fp80 }* %tmp to i8*             ; <i8*> [#uses=1]
25         %memtmp2 = bitcast { x86_fp80, x86_fp80 }* %memtmp to i8*               ; <i8*> [#uses=1]
26         call void @llvm.memcpy.i32( i8* %tmp1, i8* %memtmp2, i32 24, i32 8 )
27         %z3 = bitcast { x86_fp80, x86_fp80 }* %z to i8*         ; <i8*> [#uses=1]
28         %tmp4 = bitcast { x86_fp80, x86_fp80 }* %tmp to i8*             ; <i8*> [#uses=1]
29         call void @llvm.memcpy.i32( i8* %z3, i8* %tmp4, i32 24, i32 8 )
30         %tmp5 = call fastcc x86_fp80 @passed_uninitialized( { x86_fp80, x86_fp80 }* %z )                ; <x86_fp80> [#uses=0]
31         ret void
32 }
33
34 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind