blob: 056e944321fc48fc1f522c7d709e71fe5ab46b0f [file] [log] [blame]
Zaara Syeda1f59ae32018-01-30 16:17:22 +00001; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=COLDCC
2
3define signext i32 @caller(i32 signext %a, i32 signext %b, i32 signext %cold) {
4entry:
5 %0 = tail call i32 asm "add $0, $1, $2", "=r,r,r,~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"(i32 %a, i32 %b)
6 %mul = mul nsw i32 %0, %cold
7 %tobool = icmp eq i32 %cold, 0
8 br i1 %tobool, label %if.end, label %if.then
9
10if.then: ; preds = %entry
11 %mul1 = mul nsw i32 %mul, %cold
12 %mul2 = mul nsw i32 %b, %a
13 %call = tail call coldcc signext i32 @callee(i32 signext %a, i32 signext %b)
14 %add = add i32 %mul2, %a
15 %add3 = add i32 %add, %mul
16 %add4 = add i32 %add3, %mul1
17 %add5 = add i32 %add4, %call
18 br label %if.end
19
20if.end: ; preds = %entry, %if.then
21 %f.0 = phi i32 [ %add5, %if.then ], [ %0, %entry ]
22 ret i32 %f.0
23}
24
25define internal coldcc signext i32 @callee(i32 signext %a, i32 signext %b) local_unnamed_addr #0 {
26entry:
27; COLDCC: @callee
28; COLDCC: std 6, -8(1)
29; COLDCC: std 7, -16(1)
30; COLDCC: std 8, -24(1)
31; COLDCC: std 9, -32(1)
32; COLDCC: std 10, -40(1)
33; COLDCC: ld 9, -32(1)
34; COLDCC: ld 8, -24(1)
35; COLDCC: ld 7, -16(1)
36; COLDCC: ld 10, -40(1)
37; COLDCC: ld 6, -8(1)
38 %0 = tail call i32 asm "add $0, $1, $2", "=r,r,r,~{r6},~{r7},~{r8},~{r9},~{r10}"(i32 %a, i32 %b)
39 %mul = mul nsw i32 %a, 3
40 %1 = mul i32 %b, -5
41 %add = add i32 %1, %mul
42 %sub = add i32 %add, %0
43 ret i32 %sub
44}
45
46attributes #0 = { noinline }