forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWDEV-321398: replace hostcall module flag with function attribute
This internal version is currently a squash of four upstream reviews: 1. D119087: [AMDGPU] [NFC] refactor the AMDGPU attributor 2. D119308: [AMDGPU] [NFC] Fix incorrect use of bitwise operator. 3. D119249: [Attributor][NFC] Expose new API in AAPointerInfo 4. D119216: [AMDGPU] replace hostcall module flag with function attribute Of these #1, #2 and #3 are submitted in upstream/main, while #4 is under review. The module flag to indicate use of hostcall is insufficient to catch all cases where hostcall might be in use by a kernel. This is now replaced by a function attribute that gets propagated to top-level kernel functions via their respective call-graph. If the attribute "amdgpu-no-hostcall-ptr" is absent on a kernel, the default behaviour is to emit kernel metadata indicating that the kernel uses the hostcall buffer pointer passed as an implicit argument. The attribute may be placed explicitly by the user, or inferred by the AMDGPU attributor by examining the call-graph. The attribute is inferred only if the function is not being sanitized, and the implictarg_ptr does not result in a load of any byte in the hostcall pointer argument. Change-Id: I6cc12050602c3f477575c3ca09a883797169e9e3
- Loading branch information
Showing
27 changed files
with
623 additions
and
348 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===--- AMDGPUAttributes.def ---------------------------------*- C++ -*---===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file contains descriptions of the various function attributes | ||
// that indicate *absence* of the corresponding implicit kernel | ||
// arguments. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// NOTE: NO INCLUDE GUARD DESIRED! | ||
|
||
AMDGPU_ATTRIBUTE(DISPATCH_PTR, "amdgpu-no-dispatch-ptr") | ||
AMDGPU_ATTRIBUTE(QUEUE_PTR, "amdgpu-no-queue-ptr") | ||
AMDGPU_ATTRIBUTE(DISPATCH_ID, "amdgpu-no-dispatch-id") | ||
AMDGPU_ATTRIBUTE(IMPLICIT_ARG_PTR, "amdgpu-no-implicitarg-ptr") | ||
AMDGPU_ATTRIBUTE(HOSTCALL_PTR, "amdgpu-no-hostcall-ptr") | ||
AMDGPU_ATTRIBUTE(WORKGROUP_ID_X, "amdgpu-no-workgroup-id-x") | ||
AMDGPU_ATTRIBUTE(WORKGROUP_ID_Y, "amdgpu-no-workgroup-id-y") | ||
AMDGPU_ATTRIBUTE(WORKGROUP_ID_Z, "amdgpu-no-workgroup-id-z") | ||
AMDGPU_ATTRIBUTE(WORKITEM_ID_X, "amdgpu-no-workitem-id-x") | ||
AMDGPU_ATTRIBUTE(WORKITEM_ID_Y, "amdgpu-no-workitem-id-y") | ||
AMDGPU_ATTRIBUTE(WORKITEM_ID_Z, "amdgpu-no-workitem-id-z") | ||
|
||
#undef AMDGPU_ATTRIBUTE |
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.