• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -sroa -S | FileCheck %s
2target datalayout = "E-m:e-i64:64-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5%struct.ld2 = type { [2 x ppc_fp128] }
6declare void @bar(i8*, [2 x i128])
7
8define void @foo(i8* %v) #0 {
9entry:
10  %v.addr = alloca i8*, align 8
11  %z = alloca %struct.ld2, align 16
12  store i8* %v, i8** %v.addr, align 8
13  %dat = getelementptr inbounds %struct.ld2, %struct.ld2* %z, i32 0, i32 0
14  %arrayidx = getelementptr inbounds [2 x ppc_fp128], [2 x ppc_fp128]* %dat, i32 0, i64 0
15  store ppc_fp128 0xM403B0000000000000000000000000000, ppc_fp128* %arrayidx, align 16
16  %dat1 = getelementptr inbounds %struct.ld2, %struct.ld2* %z, i32 0, i32 0
17  %arrayidx2 = getelementptr inbounds [2 x ppc_fp128], [2 x ppc_fp128]* %dat1, i32 0, i64 1
18  store ppc_fp128 0xM4093B400000000000000000000000000, ppc_fp128* %arrayidx2, align 16
19  %0 = load i8*, i8** %v.addr, align 8
20  %coerce.dive = getelementptr %struct.ld2, %struct.ld2* %z, i32 0, i32 0
21  %1 = bitcast [2 x ppc_fp128]* %coerce.dive to [2 x i128]*
22  %2 = load [2 x i128], [2 x i128]* %1, align 1
23  call void @bar(i8* %0, [2 x i128] %2)
24  ret void
25}
26
27; CHECK-LABEL: @foo
28; CHECK-NOT: i128 4628293042053316608
29; CHECK-NOT: i128 4653260752096854016
30; CHECK-DAG: bitcast ppc_fp128 0xM403B0000000000000000000000000000 to i128
31; CHECK-DAG: bitcast ppc_fp128 0xM4093B400000000000000000000000000 to i128
32; CHECK: call void @bar(i8* %v, [2 x i128]
33; CHECK: ret void
34
35attributes #0 = { nounwind }
36
37