File: 2008-02-24-MultipleUseofSRet.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (48 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=memcpyopt,dse -S -verify-memoryssa | FileCheck %s
; PR2077

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"
target triple = "i386-pc-linux-gnu"

%0 = type { x86_fp80, x86_fp80 }

define internal fastcc void @initialize(ptr noalias nocapture sret(%0) %agg.result) nounwind {
; CHECK-LABEL: @initialize(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    store x86_fp80 0xK00000000000000000000, ptr [[AGG_RESULT:%.*]], align 4
; CHECK-NEXT:    [[AGG_RESULT_15:%.*]] = getelementptr [[TMP0:%.*]], ptr [[AGG_RESULT]], i32 0, i32 1
; CHECK-NEXT:    store x86_fp80 0xK00000000000000000000, ptr [[AGG_RESULT_15]], align 4
; CHECK-NEXT:    ret void
;
entry:
  store x86_fp80 0xK00000000000000000000, ptr %agg.result
  %agg.result.15 = getelementptr %0, ptr %agg.result, i32 0, i32 1
  store x86_fp80 0xK00000000000000000000, ptr %agg.result.15
  ret void
}

declare fastcc x86_fp80 @passed_uninitialized(ptr nocapture) nounwind

define fastcc void @badly_optimized() nounwind {
; CHECK-LABEL: @badly_optimized(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[Z:%.*]] = alloca [[TMP0:%.*]], align 8
; CHECK-NEXT:    [[TMP:%.*]] = alloca [[TMP0]], align 8
; CHECK-NEXT:    [[MEMTMP:%.*]] = alloca [[TMP0]], align 8
; CHECK-NEXT:    call fastcc void @initialize(ptr noalias sret([[TMP0]]) [[Z]])
; CHECK-NEXT:    [[TMP5:%.*]] = call fastcc x86_fp80 @passed_uninitialized(ptr [[Z]])
; CHECK-NEXT:    ret void
;
entry:
  %z = alloca %0
  %tmp = alloca %0
  %memtmp = alloca %0, align 8
  call fastcc void @initialize(ptr noalias sret(%0) %memtmp)
  call void @llvm.memcpy.p0.p0.i32(ptr align 8 %tmp, ptr align 8 %memtmp, i32 24, i1 false)
  call void @llvm.memcpy.p0.p0.i32(ptr align 8 %z, ptr align 8 %tmp, i32 24, i1 false)
  %tmp5 = call fastcc x86_fp80 @passed_uninitialized(ptr %z)
  ret void
}

declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind