mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
3cd950e7bc
This patch adds attributes corresponding to implicits to functions/kernels if 1. it has an indirect call OR 2. it's address is taken. Once such attributes are set, rest of the codegen would work out-of-box for indirect calls. This patch eliminates the potential overhead -fixed-abi imposes even though indirect functions calls are not used. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D99347
26 lines
1.4 KiB
LLVM
26 lines
1.4 KiB
LLVM
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=GCN %s
|
|
|
|
; GCN-LABEL: define internal void @indirect() #0 {
|
|
define internal void @indirect() {
|
|
ret void
|
|
}
|
|
|
|
; GCN-LABEL: define internal void @direct() #1 {
|
|
define internal void @direct() {
|
|
%fptr = alloca void()*
|
|
store void()* @indirect, void()** %fptr
|
|
%fp = load void()*, void()** %fptr
|
|
call void %fp()
|
|
ret void
|
|
}
|
|
|
|
; GCN-LABEL: define amdgpu_kernel void @test_direct_indirect_call() #2 {
|
|
define amdgpu_kernel void @test_direct_indirect_call() {
|
|
call void @direct()
|
|
ret void
|
|
}
|
|
|
|
; attributes #0 = { "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-work-group-id-x" "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "amdgpu-work-item-id-x" "amdgpu-work-item-id-y" "amdgpu-work-item-id-z" }
|
|
; attributes #1 = { "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-stack-objects" "amdgpu-work-group-id-x" "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "amdgpu-work-item-id-x" "amdgpu-work-item-id-y" "amdgpu-work-item-id-z" "uniform-work-group-size"="false" }
|
|
; attributes #2 = { "amdgpu-calls" "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-work-group-id-x" "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "amdgpu-work-item-id-x" "amdgpu-work-item-id-y" "amdgpu-work-item-id-z" "uniform-work-group-size"="false" }
|