mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-01 21:04:04 -04:00
[AMDGPU] Improve code size cost model
Summary: Added estimation for zero size insertelement, extractelement and llvm.fabs operators. Updated inline/unroll parameters default values. Reviewers: rampitec, arsenm Reviewed By: arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68881 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa %s | FileCheck -check-prefixes=GCN,CI %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,VI %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX9 %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa %s | FileCheck -check-prefixes=GCN,CI %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
|
||||
|
||||
; GCN: 'extractelement_v2i32'
|
||||
; GCN: estimated cost of 0 for {{.*}} extractelement <2 x i32>
|
||||
@@ -113,8 +117,7 @@ define amdgpu_kernel void @extractelement_v4i8(i8 addrspace(1)* %out, <4 x i8> a
|
||||
|
||||
; GCN: 'extractelement_0_v2i16':
|
||||
; CI: estimated cost of 1 for {{.*}} extractelement <2 x i16> %vec, i16 0
|
||||
; VI: estimated cost of 0 for {{.*}} extractelement <2 x i16>
|
||||
; GFX9: estimated cost of 0 for {{.*}} extractelement <2 x i16>
|
||||
; GFX89: estimated cost of 0 for {{.*}} extractelement <2 x i16>
|
||||
define amdgpu_kernel void @extractelement_0_v2i16(i16 addrspace(1)* %out, <2 x i16> addrspace(1)* %vaddr) {
|
||||
%vec = load <2 x i16>, <2 x i16> addrspace(1)* %vaddr
|
||||
%elt = extractelement <2 x i16> %vec, i16 0
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
|
||||
|
||||
; CHECK: 'fabs_f32'
|
||||
; CHECK-LABEL: 'fabs_f32'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call float @llvm.fabs.f32
|
||||
define amdgpu_kernel void @fabs_f32(float addrspace(1)* %out, float addrspace(1)* %vaddr) #0 {
|
||||
%vec = load float, float addrspace(1)* %vaddr
|
||||
@@ -9,7 +10,7 @@ define amdgpu_kernel void @fabs_f32(float addrspace(1)* %out, float addrspace(1)
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v2f32'
|
||||
; CHECK-LABEL: 'fabs_v2f32'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <2 x float> @llvm.fabs.v2f32
|
||||
define amdgpu_kernel void @fabs_v2f32(<2 x float> addrspace(1)* %out, <2 x float> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <2 x float>, <2 x float> addrspace(1)* %vaddr
|
||||
@@ -18,7 +19,7 @@ define amdgpu_kernel void @fabs_v2f32(<2 x float> addrspace(1)* %out, <2 x float
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v3f32'
|
||||
; CHECK-LABEL: 'fabs_v3f32'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <3 x float> @llvm.fabs.v3f32
|
||||
define amdgpu_kernel void @fabs_v3f32(<3 x float> addrspace(1)* %out, <3 x float> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <3 x float>, <3 x float> addrspace(1)* %vaddr
|
||||
@@ -27,7 +28,7 @@ define amdgpu_kernel void @fabs_v3f32(<3 x float> addrspace(1)* %out, <3 x float
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v5f32'
|
||||
; CHECK-LABEL: 'fabs_v5f32'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <5 x float> @llvm.fabs.v5f32
|
||||
define amdgpu_kernel void @fabs_v5f32(<5 x float> addrspace(1)* %out, <5 x float> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <5 x float>, <5 x float> addrspace(1)* %vaddr
|
||||
@@ -36,7 +37,7 @@ define amdgpu_kernel void @fabs_v5f32(<5 x float> addrspace(1)* %out, <5 x float
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_f64'
|
||||
; CHECK-LABEL: 'fabs_f64'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call double @llvm.fabs.f64
|
||||
define amdgpu_kernel void @fabs_f64(double addrspace(1)* %out, double addrspace(1)* %vaddr) #0 {
|
||||
%vec = load double, double addrspace(1)* %vaddr
|
||||
@@ -45,7 +46,7 @@ define amdgpu_kernel void @fabs_f64(double addrspace(1)* %out, double addrspace(
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v2f64'
|
||||
; CHECK-LABEL: 'fabs_v2f64'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <2 x double> @llvm.fabs.v2f64
|
||||
define amdgpu_kernel void @fabs_v2f64(<2 x double> addrspace(1)* %out, <2 x double> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <2 x double>, <2 x double> addrspace(1)* %vaddr
|
||||
@@ -54,7 +55,7 @@ define amdgpu_kernel void @fabs_v2f64(<2 x double> addrspace(1)* %out, <2 x doub
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v3f64'
|
||||
; CHECK-LABEL: 'fabs_v3f64'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <3 x double> @llvm.fabs.v3f64
|
||||
define amdgpu_kernel void @fabs_v3f64(<3 x double> addrspace(1)* %out, <3 x double> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <3 x double>, <3 x double> addrspace(1)* %vaddr
|
||||
@@ -63,7 +64,7 @@ define amdgpu_kernel void @fabs_v3f64(<3 x double> addrspace(1)* %out, <3 x doub
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_f16'
|
||||
; CHECK-LABEL: 'fabs_f16'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call half @llvm.fabs.f16
|
||||
define amdgpu_kernel void @fabs_f16(half addrspace(1)* %out, half addrspace(1)* %vaddr) #0 {
|
||||
%vec = load half, half addrspace(1)* %vaddr
|
||||
@@ -72,7 +73,7 @@ define amdgpu_kernel void @fabs_f16(half addrspace(1)* %out, half addrspace(1)*
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v2f16'
|
||||
; CHECK-LABEL: 'fabs_v2f16'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <2 x half> @llvm.fabs.v2f16
|
||||
define amdgpu_kernel void @fabs_v2f16(<2 x half> addrspace(1)* %out, <2 x half> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <2 x half>, <2 x half> addrspace(1)* %vaddr
|
||||
@@ -81,7 +82,7 @@ define amdgpu_kernel void @fabs_v2f16(<2 x half> addrspace(1)* %out, <2 x half>
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: 'fabs_v3f16'
|
||||
; CHECK-LABEL: 'fabs_v3f16'
|
||||
; CHECK: estimated cost of 0 for {{.*}} call <3 x half> @llvm.fabs.v3f16
|
||||
define amdgpu_kernel void @fabs_v3f16(<3 x half> addrspace(1)* %out, <3 x half> addrspace(1)* %vaddr) #0 {
|
||||
%vec = load <3 x half>, <3 x half> addrspace(1)* %vaddr
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa %s | FileCheck -check-prefixes=GCN,CI %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,VI %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX9 %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa %s | FileCheck -check-prefixes=GCN,CI %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 %s | FileCheck -check-prefixes=GCN,GFX89 %s
|
||||
|
||||
; GCN-LABEL: 'insertelement_v2i32'
|
||||
; GCN: estimated cost of 0 for {{.*}} insertelement <2 x i32>
|
||||
@@ -22,8 +25,7 @@ define amdgpu_kernel void @insertelement_v2i64(<2 x i64> addrspace(1)* %out, <2
|
||||
|
||||
; GCN-LABEL: 'insertelement_0_v2i16'
|
||||
; CI: estimated cost of 1 for {{.*}} insertelement <2 x i16>
|
||||
; VI: estimated cost of 0 for {{.*}} insertelement <2 x i16>
|
||||
; GFX9: estimated cost of 0 for {{.*}} insertelement <2 x i16>
|
||||
; GFX89: estimated cost of 0 for {{.*}} insertelement <2 x i16>
|
||||
define amdgpu_kernel void @insertelement_0_v2i16(<2 x i16> addrspace(1)* %out, <2 x i16> addrspace(1)* %vaddr) {
|
||||
%vec = load <2 x i16>, <2 x i16> addrspace(1)* %vaddr
|
||||
%insert = insertelement <2 x i16> %vec, i16 123, i16 0
|
||||
|
||||
Reference in New Issue
Block a user