Switch to using BitIntegerState for each of the inputs, and invert their meanings. This now diverges more from the old AMDGPUAnnotateKernelFeatures, but this isn't used yet anyway.
49 lines
2.6 KiB
LLVM
49 lines
2.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
|
|
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefixes=GCN,AKF_GCN %s
|
|
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck -check-prefixes=GCN,ATTRIBUTOR_GCN %s
|
|
|
|
define internal void @indirect() {
|
|
; GCN-LABEL: define {{[^@]+}}@indirect
|
|
; GCN-SAME: () #[[ATTR0:[0-9]+]] {
|
|
; GCN-NEXT: ret void
|
|
;
|
|
; CHECK-LABEL: define {{[^@]+}}@indirect
|
|
; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: ret void
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @test_simple_indirect_call() #0 {
|
|
; GCN-LABEL: define {{[^@]+}}@test_simple_indirect_call
|
|
; GCN-SAME: () #[[ATTR1:[0-9]+]] {
|
|
; GCN-NEXT: [[FPTR:%.*]] = alloca void ()*, align 8
|
|
; GCN-NEXT: store void ()* @indirect, void ()** [[FPTR]], align 8
|
|
; GCN-NEXT: [[FP:%.*]] = load void ()*, void ()** [[FPTR]], align 8
|
|
; GCN-NEXT: call void [[FP]]()
|
|
; GCN-NEXT: ret void
|
|
;
|
|
; CHECK-LABEL: define {{[^@]+}}@test_simple_indirect_call
|
|
; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
|
|
; CHECK-NEXT: [[FPTR:%.*]] = alloca void ()*, align 8
|
|
; CHECK-NEXT: store void ()* @indirect, void ()** [[FPTR]], align 8
|
|
; CHECK-NEXT: [[FP:%.*]] = load void ()*, void ()** [[FPTR]], align 8
|
|
; CHECK-NEXT: call void [[FP]]()
|
|
; CHECK-NEXT: ret void
|
|
%fptr = alloca void()*
|
|
store void()* @indirect, void()** %fptr
|
|
%fp = load void()*, void()** %fptr
|
|
call void %fp()
|
|
ret void
|
|
}
|
|
|
|
; FIXME: Switch this to no-dispatch-id
|
|
attributes #0 = { "amdgpu-dispatch-id" }
|
|
|
|
;.
|
|
; AKF_GCN: attributes #[[ATTR0]] = { "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-queue-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" }
|
|
; AKF_GCN: attributes #[[ATTR1]] = { "amdgpu-calls" "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-queue-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" }
|
|
;.
|
|
; ATTRIBUTOR_GCN: attributes #[[ATTR0]] = { "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "uniform-work-group-size"="false" }
|
|
; ATTRIBUTOR_GCN: attributes #[[ATTR1]] = { "amdgpu-dispatch-id" "uniform-work-group-size"="false" }
|
|
;.
|