blob: c871d54bec7ed623c1c6ab3730da85c5d9c8bc72 [file] [log] [blame]
Stanislav Mekhanoshin9053f222017-03-28 18:23:24 +00001; RUN: opt -mtriple=amdgcn-- -O1 -S -inline-threshold=1 -amdgpu-early-inline-all %s | FileCheck %s
Konstantin Zhuravlyov2534bc02017-03-20 18:06:45 +00002
Stanislav Mekhanoshin89653df2017-03-30 20:16:02 +00003; CHECK: @c_alias
4@c_alias = alias i32 (i32), i32 (i32)* @callee
5
Konstantin Zhuravlyov2534bc02017-03-20 18:06:45 +00006define i32 @callee(i32 %x) {
7entry:
8 %mul1 = mul i32 %x, %x
9 %mul2 = mul i32 %mul1, %x
10 %mul3 = mul i32 %mul1, %mul2
11 %mul4 = mul i32 %mul3, %mul2
12 %mul5 = mul i32 %mul4, %mul3
13 ret i32 %mul5
14}
15
16; CHECK-LABEL: @caller
17; CHECK: mul i32
18; CHECK-NOT: call i32
19
Matt Arsenault33339682017-04-04 18:43:11 +000020define amdgpu_kernel void @caller(i32 %x) {
Konstantin Zhuravlyov2534bc02017-03-20 18:06:45 +000021entry:
22 %res = call i32 @callee(i32 %x)
Matt Arsenault33339682017-04-04 18:43:11 +000023 store volatile i32 %res, i32 addrspace(1)* undef
24 ret void
Konstantin Zhuravlyov2534bc02017-03-20 18:06:45 +000025}