llvm
llvm copied to clipboard
[SYCL] Add warning for attributes applied to non-kernel functions
According to 5.8.1. Kernel attributes, kernel attributes can only be applied to SYCL kernel functions, but not to a regular device functions.
Based on this information, this pull request introduces a warning diagnostic whenever specified attributes are applied to regular device functions.
@intel/dpcpp-cfe-reviewers Can you review?
@premanandrao I did requested changes can you look over them? Thanks
@elizabethandrews Do you know how to check if function is a kernel in CollectSyclExternalFuncs?
@elizabethandrews Do you know how to check if function is a kernel in CollectSyclExternalFuncs?
I think CollectSyclExternalFuncs only collects SYCL_EXTERNAL functions. So that is a dead end. Since you want the diagnostic emitted for non-device functions as well, I think it needs to be handled the way you currently do in the deferred diagnostics framework. I am not sure if I am missing something though. @premanandrao do you have insight here? I also noticed the diagnostics are not emitted on declarations which is a bit odd but I am not sure what the solution is
Okay, I investigated it, and it seems that dependency checks on attributes were unnecessary.
@elizabethandrews Could you look at my changes?
@mdtoguchi - Driver/sycl.c on Windows has been failing in post-commit as of yesterday for unrelated changes (https://github.com/intel/llvm/pull/15297) and this PR is the first case I've seen it fail in pre-commit. Do you have any idea of how to address it? Can we disable it temporarily?
@mdtoguchi - Driver/sycl.c on Windows has been failing in post-commit as of yesterday for unrelated changes (#15297) and this PR is the first case I've seen it fail in pre-commit. Do you have any idea of how to address it? Can we disable it temporarily?
@steffenlarsen, it should be OK to disable temporarily (maybe just use REQUIRES: system-linux) until I can figure out what is going on.
Failure in Driver/sycl.c for Windows is known and will be disabled in https://github.com/intel/llvm/pull/15416.