1; RUN: opt -mtriple=amdgcn-- -O1 -S -inline-threshold=1 -amdgpu-early-inline-all %s | FileCheck %s
2
3@c_alias = alias i32 (i32), i32 (i32)* @callee
4
5define i32 @callee(i32 %x) {
6entry:
7  %mul1 = mul i32 %x, %x
8  %mul2 = mul i32 %mul1, %x
9  %mul3 = mul i32 %mul1, %mul2
10  %mul4 = mul i32 %mul3, %mul2
11  %mul5 = mul i32 %mul4, %mul3
12  ret i32 %mul5
13}
14
15; CHECK-LABEL: @caller
16; CHECK: mul i32
17; CHECK-NOT: call i32
18
19define amdgpu_kernel void @caller(i32 %x) {
20entry:
21  %res = call i32 @callee(i32 %x)
22  store volatile i32 %res, i32 addrspace(1)* undef
23  ret void
24}
25
26; CHECK-LABEL: @alias_caller(
27; CHECK-NOT: call
28define amdgpu_kernel void @alias_caller(i32 %x) {
29entry:
30  %res = call i32 @c_alias(i32 %x)
31  store volatile i32 %res, i32 addrspace(1)* undef
32  ret void
33}
34