brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 71c509a Raw
75 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 52; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -passes=amdgpu-attributor -mcpu=gfx90a %s | FileCheck %s3 4; Make sure we infer no inputs are used through some intrinsics5 6define void @use_fake_use(i32 %arg) {7; CHECK-LABEL: define void @use_fake_use(8; CHECK-SAME: i32 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {9; CHECK-NEXT:    call void (...) @llvm.fake.use(i32 [[ARG]])10; CHECK-NEXT:    ret void11;12  call void (...) @llvm.fake.use(i32 %arg)13  ret void14}15 16define void @use_donothing() {17; CHECK-LABEL: define void @use_donothing(18; CHECK-SAME: ) #[[ATTR0]] {19; CHECK-NEXT:    call void @llvm.donothing()20; CHECK-NEXT:    ret void21;22  call void @llvm.donothing()23  ret void24}25 26define void @use_assume(i1 %arg) {27; CHECK-LABEL: define void @use_assume(28; CHECK-SAME: i1 [[ARG:%.*]]) #[[ATTR0]] {29; CHECK-NEXT:    call void @llvm.assume(i1 [[ARG]])30; CHECK-NEXT:    ret void31;32  call void @llvm.assume(i1 %arg)33  ret void34}35 36define void @use_trap() {37; CHECK-LABEL: define void @use_trap(38; CHECK-SAME: ) #[[ATTR1:[0-9]+]] {39; CHECK-NEXT:    call void @llvm.trap()40; CHECK-NEXT:    ret void41;42  call void @llvm.trap()43  ret void44}45 46define void @use_debugtrap() {47; CHECK-LABEL: define void @use_debugtrap(48; CHECK-SAME: ) #[[ATTR1]] {49; CHECK-NEXT:    call void @llvm.debugtrap()50; CHECK-NEXT:    ret void51;52  call void @llvm.debugtrap()53  ret void54}55 56define void @use_ubsantrap() {57; CHECK-LABEL: define void @use_ubsantrap(58; CHECK-SAME: ) #[[ATTR1]] {59; CHECK-NEXT:    call void @llvm.ubsantrap(i8 0)60; CHECK-NEXT:    ret void61;62  call void @llvm.ubsantrap(i8 0)63  ret void64}65 66;.67; CHECK: attributes #[[ATTR0]] = { "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" "uniform-work-group-size"="false" }68; CHECK: attributes #[[ATTR1]] = { "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" "uniform-work-group-size"="false" }69; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) "target-cpu"="gfx90a" }70; CHECK: attributes #[[ATTR3:[0-9]+]] = { nounwind "target-cpu"="gfx90a" }71; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(none) "target-cpu"="gfx90a" }72; CHECK: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) "target-cpu"="gfx90a" }73; CHECK: attributes #[[ATTR6:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) "target-cpu"="gfx90a" }74;.75