Alex MacLean 07ed8187ac
[OpenMP] Replace nvvm.annotation usage with kernel calling conventions (#122320)
Specifying a kernel with the `ptx_kernel` or `amdgpu_kernel` calling
convention is a more idiomatic and compile-time performant than using
the `nvvm.annoation !"kernel"` metadata.

Transition OMPIRBuilder to use calling conventions for PTX kernels and
no longer emit `nvvm.annoation`. Update OpenMPOpt to work with kernels
specified via calling convention as well as metadata. Update OpenMP
tests to use the calling conventions.
2025-01-24 16:56:10 -08:00

27 lines
769 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 3
; RUN: opt < %s -S -passes=openmp-opt | FileCheck %s
source_filename = "bug66687.ll"
target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
target triple = "nvptx64-nvidia-cuda"
define weak ptx_kernel void @openmp_kernel() "kernel" {
; CHECK-LABEL: define weak ptx_kernel void @openmp_kernel(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: ret void
;
ret void
}
define weak_odr ptx_kernel void @non_openmp_kernel() {
; CHECK-LABEL: define weak_odr ptx_kernel void @non_openmp_kernel() {
; CHECK-NEXT: ret void
;
ret void
}
!llvm.module.flags = !{!0, !1}
!0 = !{i32 7, !"openmp", i32 51}
!1 = !{i32 7, !"openmp-device", i32 51}