blob: a4f970ee238a8ffc3d362da2d3bd681290ad40eb [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@c_alias = alias i32 (i32), i32 (i32)* @callee
4
Konstantin Zhuravlyov2534bc02017-03-20 18:06:45 +00005define 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
Vlad Tsyrklevich688e7522018-07-10 00:46:07 +000019; CHECK: define i32 @c_alias
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}