| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5 |
| ; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a -passes=amdgpu-attributor %s | FileCheck %s |
| |
| ; Make sure we do not infer anything about implicit inputs through an |
| ; intrinsic call which is not nocallback. |
| |
| declare zeroext i32 @return_i32() |
| |
| define i32 @test_i32_return() gc "statepoint-example" { |
| ; CHECK-LABEL: define i32 @test_i32_return( |
| ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] gc "statepoint-example" { |
| ; CHECK-NEXT: [[ENTRY:.*:]] |
| ; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) @return_i32, i32 0, i32 0, i32 0, i32 0) |
| ; CHECK-NEXT: [[CALL1:%.*]] = call zeroext i32 @llvm.experimental.gc.result.i32(token [[SAFEPOINT_TOKEN]]) |
| ; CHECK-NEXT: ret i32 [[CALL1]] |
| ; |
| entry: |
| %safepoint_token = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) @return_i32, i32 0, i32 0, i32 0, i32 0) |
| %call1 = call zeroext i32 @llvm.experimental.gc.result.i32(token %safepoint_token) |
| ret i32 %call1 |
| } |
| |
| declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) |
| declare i32 @llvm.experimental.gc.result.i32(token) #0 |
| |
| attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) } |
| ;. |
| ; CHECK: attributes #[[ATTR0]] = { "target-cpu"="gfx90a" "uniform-work-group-size"="false" } |
| ; CHECK: attributes #[[ATTR1:[0-9]+]] = { "target-cpu"="gfx90a" } |
| ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(none) "target-cpu"="gfx90a" } |
| ;. |