[llvm] [AMDGPU] Add backward compatibility layer for kernarg preloading (PR #119167)
Janek van Oirschot via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 12:32:54 PST 2024
================
@@ -0,0 +1,229 @@
+//===- AMDGPUPreloadKernargHeader.cpp - Preload Kernarg Header ------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file This pass handles the creation of the backwards compatability layer
+/// for kernarg prealoding. Code may be compiled with the feature enabled, while
+/// the kernel is executed on hardware without firmware support.
+///
+/// To avoid the need for recompilation, we insert a block at the beginning of
+/// the kernel that is responsible for loading the kernel arguments into SGPRs
+/// using s_load instructions which setup the registers exactly as they would be
+/// by firmware if the code were executed on a system that supported kernarg
+/// preladoing.
----------------
JanekvO wrote:
```suggestion
/// preloading.
```
https://github.com/llvm/llvm-project/pull/119167
More information about the llvm-commits
mailing list