2017-03-29 02:23:24 +08:00
|
|
|
; RUN: opt -mtriple=amdgcn-- -O1 -S -inline-threshold=1 -amdgpu-early-inline-all %s | FileCheck %s
|
2017-03-21 02:06:45 +08:00
|
|
|
|
2017-03-31 04:16:02 +08:00
|
|
|
@c_alias = alias i32 (i32), i32 (i32)* @callee
|
|
|
|
|
2017-03-21 02:06:45 +08:00
|
|
|
define i32 @callee(i32 %x) {
|
|
|
|
entry:
|
|
|
|
%mul1 = mul i32 %x, %x
|
|
|
|
%mul2 = mul i32 %mul1, %x
|
|
|
|
%mul3 = mul i32 %mul1, %mul2
|
|
|
|
%mul4 = mul i32 %mul3, %mul2
|
|
|
|
%mul5 = mul i32 %mul4, %mul3
|
|
|
|
ret i32 %mul5
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @caller
|
|
|
|
; CHECK: mul i32
|
|
|
|
; CHECK-NOT: call i32
|
|
|
|
|
2017-04-05 02:43:11 +08:00
|
|
|
define amdgpu_kernel void @caller(i32 %x) {
|
2017-03-21 02:06:45 +08:00
|
|
|
entry:
|
|
|
|
%res = call i32 @callee(i32 %x)
|
2017-04-05 02:43:11 +08:00
|
|
|
store volatile i32 %res, i32 addrspace(1)* undef
|
|
|
|
ret void
|
2017-03-21 02:06:45 +08:00
|
|
|
}
|
2018-07-10 22:03:41 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: @alias_caller(
|
|
|
|
; CHECK-NOT: call
|
|
|
|
define amdgpu_kernel void @alias_caller(i32 %x) {
|
|
|
|
entry:
|
|
|
|
%res = call i32 @c_alias(i32 %x)
|
|
|
|
store volatile i32 %res, i32 addrspace(1)* undef
|
|
|
|
ret void
|
|
|
|
}
|