This is one of the string attributes that takes a boolean value for no reason. There is no point in ever writing this with an explicit false. Stop adding the noise and reporting an unnecessary change.
66 lines
3.3 KiB
LLVM
66 lines
3.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 6
|
|
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -passes=amdgpu-attributor %s | FileCheck %s
|
|
|
|
; Trap-like intrinsics such as llvm.trap and llvm.debugtrap do not have the
|
|
; nocallback attribute, so the AMDGPU attributor used to conservatively drop
|
|
; all implicitly-known inputs and AGPR allocation information. Make sure we
|
|
; still infer that no implicit inputs are required and that the AGPR allocation
|
|
; stays at zero.
|
|
|
|
declare void @llvm.trap()
|
|
|
|
declare void @llvm.debugtrap()
|
|
|
|
define amdgpu_kernel void @trap_kernel() {
|
|
; CHECK-LABEL: define amdgpu_kernel void @trap_kernel(
|
|
; CHECK-SAME: ) #[[ATTR2:[0-9]+]] {
|
|
; CHECK-NEXT: call void @llvm.trap()
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @llvm.trap()
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @trap_kernel_with_handler() {
|
|
; CHECK-LABEL: define amdgpu_kernel void @trap_kernel_with_handler(
|
|
; CHECK-SAME: ) #[[ATTR3:[0-9]+]] {
|
|
; CHECK-NEXT: call void @llvm.trap() #[[ATTR4:[0-9]+]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @llvm.trap() #0
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @debugtrap_kernel() {
|
|
; CHECK-LABEL: define amdgpu_kernel void @debugtrap_kernel(
|
|
; CHECK-SAME: ) #[[ATTR2]] {
|
|
; CHECK-NEXT: call void @llvm.debugtrap()
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @llvm.debugtrap()
|
|
ret void
|
|
}
|
|
|
|
; Test that a trap with both trap-func-name and nocallback is still safe
|
|
define amdgpu_kernel void @trap_kernel_with_handler_and_nocallback() {
|
|
; CHECK-LABEL: define amdgpu_kernel void @trap_kernel_with_handler_and_nocallback(
|
|
; CHECK-SAME: ) #[[ATTR2]] {
|
|
; CHECK-NEXT: call void @llvm.trap() #[[ATTR5:[0-9]+]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @llvm.trap() #1
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { "trap-func-name"="handler" }
|
|
attributes #1 = { nocallback "trap-func-name"="handler" }
|
|
|
|
;.
|
|
; CHECK: attributes #[[ATTR0:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) "target-cpu"="gfx90a" }
|
|
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nounwind "target-cpu"="gfx90a" }
|
|
; CHECK: attributes #[[ATTR2]] = { "amdgpu-agpr-alloc"="0" "amdgpu-no-cluster-id-x" "amdgpu-no-cluster-id-y" "amdgpu-no-cluster-id-z" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "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" "target-cpu"="gfx90a" }
|
|
; CHECK: attributes #[[ATTR3]] = { "amdgpu-no-cluster-id-x" "amdgpu-no-cluster-id-y" "amdgpu-no-cluster-id-z" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "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" "target-cpu"="gfx90a" }
|
|
; CHECK: attributes #[[ATTR4]] = { "trap-func-name"="handler" }
|
|
; CHECK: attributes #[[ATTR5]] = { nocallback "trap-func-name"="handler" }
|
|
;.
|