mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
AMDGPU/SI: Emit amd_kernel_code_t in EmitFunctionBodyStart()
Summary: This way the function symbol points to the start of amd_kernel_code_t rather than the start of the function. Reviewers: arsenm Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10705 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
64b906419e
commit
0d1bd457c6
@ -89,6 +89,15 @@ AMDGPUAsmPrinter::AMDGPUAsmPrinter(TargetMachine &TM,
|
||||
std::unique_ptr<MCStreamer> Streamer)
|
||||
: AsmPrinter(TM, std::move(Streamer)) {}
|
||||
|
||||
void AMDGPUAsmPrinter::EmitFunctionBodyStart() {
|
||||
const AMDGPUSubtarget &STM = MF->getSubtarget<AMDGPUSubtarget>();
|
||||
SIProgramInfo KernelInfo;
|
||||
if (STM.isAmdHsaOS()) {
|
||||
getSIProgramInfo(KernelInfo, *MF);
|
||||
EmitAmdKernelCodeT(*MF, KernelInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void AMDGPUAsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||
|
||||
// This label is used to mark the end of the .text section.
|
||||
@ -113,13 +122,11 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
|
||||
const AMDGPUSubtarget &STM = MF.getSubtarget<AMDGPUSubtarget>();
|
||||
SIProgramInfo KernelInfo;
|
||||
if (STM.isAmdHsaOS()) {
|
||||
getSIProgramInfo(KernelInfo, MF);
|
||||
EmitAmdKernelCodeT(MF, KernelInfo);
|
||||
OutStreamer->EmitCodeAlignment(2 << (MF.getAlignment() - 1));
|
||||
} else if (STM.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
|
||||
getSIProgramInfo(KernelInfo, MF);
|
||||
EmitProgramInfoSI(MF, KernelInfo);
|
||||
if (STM.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
|
||||
if (!STM.isAmdHsaOS()) {
|
||||
getSIProgramInfo(KernelInfo, MF);
|
||||
EmitProgramInfoSI(MF, KernelInfo);
|
||||
}
|
||||
} else {
|
||||
EmitProgramInfoR600(MF);
|
||||
}
|
||||
|
@ -97,6 +97,8 @@ public:
|
||||
/// Implemented in AMDGPUMCInstLower.cpp
|
||||
void EmitInstruction(const MachineInstr *MI) override;
|
||||
|
||||
void EmitFunctionBodyStart() override;
|
||||
|
||||
void EmitEndOfAsmFile(Module &M) override;
|
||||
|
||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
|
@ -1,8 +1,10 @@
|
||||
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA %s
|
||||
|
||||
; HSA: {{^}}simple:
|
||||
; HSA: .section .hsa.version
|
||||
; HSA-NEXT: .ascii "HSA Code Unit:0.0:AMD:0.1:GFX8.1:0"
|
||||
; HSA: {{^}}simple:
|
||||
; Test that the amd_kernel_code_t object is emitted
|
||||
; HSA: .asciz
|
||||
; Make sure we are setting the ATC bit:
|
||||
; HSA: s_mov_b32 s[[HI:[0-9]]], 0x100f000
|
||||
; HSA: buffer_store_dword v{{[0-9]+}}, s[0:[[HI]]], 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user