Files
clang-p2996/llvm/test/Transforms/Inline/AMDGPU/inline-amdgpu-vecbonus.ll
Daniil Fukalov d912a9ba9b [AMDGPU] Tune inlining parameters for AMDGPU target
Summary:
Since the target has no significant advantage of vectorization,
vector instructions bous threshold bonus should be optional.

amdgpu-inline-arg-alloca-cost parameter default value and the target
InliningThresholdMultiplier value tuned then respectively.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64642

llvm-svn: 366348
2019-07-17 16:51:29 +00:00

32 lines
1.2 KiB
LLVM

; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -amdgpu-inline --inline-threshold=1 < %s | FileCheck %s
define hidden <16 x i32> @div_vecbonus(<16 x i32> %x, <16 x i32> %y) {
entry:
%div.1 = udiv <16 x i32> %x, %y
%div.2 = udiv <16 x i32> %div.1, %y
%div.3 = udiv <16 x i32> %div.2, %y
%div.4 = udiv <16 x i32> %div.3, %y
%div.5 = udiv <16 x i32> %div.4, %y
%div.6 = udiv <16 x i32> %div.5, %y
%div.7 = udiv <16 x i32> %div.6, %y
%div.8 = udiv <16 x i32> %div.7, %y
%div.9 = udiv <16 x i32> %div.8, %y
%div.10 = udiv <16 x i32> %div.9, %y
%div.11 = udiv <16 x i32> %div.10, %y
%div.12 = udiv <16 x i32> %div.11, %y
ret <16 x i32> %div.12
}
; CHECK-LABEL: define amdgpu_kernel void @caller_vecbonus
; CHECK-NOT: udiv
; CHECK: tail call <16 x i32> @div_vecbonus
; CHECK: ret void
define amdgpu_kernel void @caller_vecbonus(<16 x i32> addrspace(1)* nocapture %x, <16 x i32> addrspace(1)* nocapture readonly %y) {
entry:
%tmp = load <16 x i32>, <16 x i32> addrspace(1)* %x
%tmp1 = load <16 x i32>, <16 x i32> addrspace(1)* %y
%div.i = tail call <16 x i32> @div_vecbonus(<16 x i32> %tmp, <16 x i32> %tmp1)
store <16 x i32> %div.i, <16 x i32> addrspace(1)* %x
ret void
}