summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/early-inline.ll
blob: db397d9e11b609edfd91c6b78dcdd9138f44a191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: opt -mtriple=amdgcn-- -O1 -S -inline-threshold=1 -amdgpu-early-inline-all %s | FileCheck %s

; CHECK: @c_alias
@c_alias = alias i32 (i32), i32 (i32)* @callee

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

define amdgpu_kernel i32 @caller(i32 %x) {
entry:
  %res = call i32 @callee(i32 %x)
  ret i32 %res
}
OpenPOWER on IntegriCloud