1 ; RUN: llc -verify-machineinstrs -O1 < %s -mcpu=pwr7 | FileCheck %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 %struct.test = type { i64, [8 x i8] }
7 %struct.pad = type { [8 x i64] }
9 @gt = common global %struct.test zeroinitializer, align 16
10 @gp = common global %struct.pad zeroinitializer, align 8
12 define signext i32 @callee1(i32 signext %x, ptr byval(%struct.test) align 16 nocapture readnone %y, i32 signext %z) {
16 ; CHECK-LABEL: @callee1
20 declare signext i32 @test1(i32 signext, ptr byval(%struct.test) align 16, i32 signext)
21 define void @caller1(i32 signext %z) {
23 %call = tail call signext i32 @test1(i32 signext 0, ptr byval(%struct.test) align 16 @gt, i32 signext %z)
26 ; CHECK-LABEL: @caller1
30 define i64 @callee2(ptr byval(%struct.pad) nocapture readnone %x, i32 signext %y, ptr byval(%struct.test) align 16 nocapture readonly %z) {
32 %0 = load i64, ptr %z, align 16
35 ; CHECK-LABEL: @callee2
36 ; CHECK: ld {{[0-9]+}}, 128(1)
39 declare i64 @test2(ptr byval(%struct.pad), i32 signext, ptr byval(%struct.test) align 16)
40 define void @caller2(i64 %z) {
42 %tmp = alloca %struct.test, align 16
43 store i64 %z, ptr %tmp, align 16
44 %call = call i64 @test2(ptr byval(%struct.pad) @gp, i32 signext 0, ptr byval(%struct.test) align 16 %tmp)
47 ; CHECK-LABEL: @caller2
48 ; CHECK-DAG: std 3, [[OFF:[0-9]+]](1)
49 ; CHECK-DAG: addi [[REG1:[0-9]+]], 1, [[OFF]]
51 ; CHECK-DAG: lxvw4x [[REG2:[0-9]+]], 0, [[REG1]]
52 ; CHECK-DAG: li [[REG3:[0-9]+]], 128
53 ; CHECK: stxvw4x 0, 1, [[REG3]]