Files
clang-p2996/clang/test/CodeGenCUDA/norecurse.cu
Yaxun (Sam) Liu fb44b9db95 [OpenCL][CUDA][HIP][SYCL] Add norecurse
norecurse function attr indicates the function is not called recursively
directly or indirectly.

Add norecurse to OpenCL functions, SYCL functions in device compilation
and CUDA/HIP kernels.

Although there is LLVM pass adding norecurse to functions, it only works
for whole-program compilation. Also FE adding norecurse can make that
pass run faster since functions with norecurse do not need to be checked
again.

Differential Revision: https://reviews.llvm.org/D73651
2020-02-16 20:41:00 -05:00

16 lines
514 B
Plaintext

// REQUIRES: amdgpu-registered-target
// REQUIRES: nvptx-registered-target
// RUN: %clang_cc1 -triple nvptx-nvidia-cuda -fcuda-is-device \
// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device \
// RUN: -emit-llvm -disable-llvm-passes -o - -x hip %s | FileCheck %s
#include "Inputs/cuda.h"
__global__ void kernel1(int a) {}
// CHECK: define{{.*}}@_Z7kernel1i{{.*}}#[[ATTR:[0-9]*]]
// CHECK: attributes #[[ATTR]] = {{.*}}norecurse