[llvm] [AMDGPU] MCExpr-ify MC layer kernel descriptor (PR #80855)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 00:53:52 PST 2024
================
@@ -420,38 +421,41 @@ uint16_t AMDGPUAsmPrinter::getAmdhsaKernelCodeProperties(
return KernelCodeProperties;
}
-amdhsa::kernel_descriptor_t AMDGPUAsmPrinter::getAmdhsaKernelDescriptor(
- const MachineFunction &MF,
- const SIProgramInfo &PI) const {
+MCKernelDescriptor
+AMDGPUAsmPrinter::getAmdhsaKernelDescriptor(const MachineFunction &MF,
+ const SIProgramInfo &PI) const {
const GCNSubtarget &STM = MF.getSubtarget<GCNSubtarget>();
const Function &F = MF.getFunction();
const SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
- amdhsa::kernel_descriptor_t KernelDescriptor;
- memset(&KernelDescriptor, 0x0, sizeof(KernelDescriptor));
+ auto CreateExpr = [&MF](int64_t Value) {
+ return MCConstantExpr::create(Value, MF.getContext());
+ };
----------------
arsenm wrote:
It's less noisy if you pull the MF.getContext() into a variable
https://github.com/llvm/llvm-project/pull/80855
More information about the llvm-commits
mailing list