forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCLLowerIR] Remove !amdgcn.annotations metadata (intel#14713)
The `!amdgcn.annotations` metadata was a SYCL-specific addition. The concept of annotations for AMDGPU makes it appear as if it's a mirror of NVVM annotations, when in fact it's just a kernel tagging mechanism. It is not a feature supported by AMD's drivers. We don't need to rely on this, as the functions' calling conventions identify kernels. We also rely on the "sycl-device" module flag to restrict the passes to SYCL code. This patch re-uses the existing `TargetHelpers` namespace to hide the target-specific logic behind a new class: the `KernelCache`. This provides a way of maintaining a cache of kernels, with optional annotation metadata (it could be expanded in the future with more types of payload). It also provides abstracted ways of handling certain RAUW operations on kernels, though currently only a minimum required to support the two existing patterns. The aim of this is to hide all concept of "annotations" from the passes, and make it an implementation detail of the `KernelCache`. During this work, it was noticed that our handling of annotations was incomplete. NVVM annotations are not required to only only have 3 operands, as the official documentation shows. It's actually a list of pairs, any one of which may declare the function a kernel. Thus we may have missed valid kernels. Tests have been added to check for this. The `GlobalOffset` pass was also treating "unsupported" architectures as AMDGPU architectures, so that has been tightened up and the tests have been updated to ensure they actually register as AMD modules. LIT tests have been cleaned up somewhat, to remove unnecessary features like comments and function linkage types. Several LIT tests have been converted to use the `update_test_checks.py` or `update_llc_test_checks.py` scripts, where appropriate. These tools cannot currently emit checks for named metadata nor certain assembly features, so some tests must remain as they are.
- Loading branch information
1 parent
10b3727
commit dc37699
Showing
44 changed files
with
1,000 additions
and
789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.