[Ventus][fix]Add local memory usage in .ventus.reousrce section

This commit is contained in:
ziliangzl 2024-06-24 16:55:47 +08:00
parent 86fac10608
commit b35eefb5de
3 changed files with 11 additions and 7 deletions

View File

@ -210,9 +210,11 @@ bool RISCVAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
OutStreamer->emitInt16(
CurrentProgramInfo->SubProgramInfoVec[FuncCount].SGPRUsage);
OutStreamer->emitInt16(
CurrentProgramInfo->SubProgramInfoVec[FuncCount].LDSMemory);
CurrentProgramInfo->SubProgramInfoVec[FuncCount].LocalSpill);
OutStreamer->emitInt16(
CurrentProgramInfo->SubProgramInfoVec[FuncCount].PDSMemory);
CurrentProgramInfo->SubProgramInfoVec[FuncCount].LocalMemoryUse);
OutStreamer->emitInt16(
CurrentProgramInfo->SubProgramInfoVec[FuncCount].PrivateSpill);
}
FuncCount++;

View File

@ -378,8 +378,9 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF,
uint64_t LocalStackSize = getStackSize(MF, RISCVStackID::LocalMemSpill);
// FIXME: need to add local data declaration calculation
CurrentSubProgramInfo->LDSMemory += SPStackSize;
CurrentSubProgramInfo->PDSMemory += TPStackSize;
CurrentSubProgramInfo->LocalSpill += SPStackSize;
CurrentSubProgramInfo->LocalMemoryUse += LocalStackSize;
CurrentSubProgramInfo->PrivateSpill += TPStackSize;
//uint64_t RealStackSize = IsEntryFunction ?
// SPStackSize + RMFI->getLibCallStackSize() :
// TPStackSize + RMFI->getLibCallStackSize();
@ -983,4 +984,4 @@ bool RISCVFrameLowering::storeRegToReg(const TargetRegisterInfo *TRI) const {
bool RISCVFrameLowering::loadRegFromReg(const TargetRegisterInfo *TRI) const {
return false;
}
}

View File

@ -22,8 +22,9 @@ namespace llvm {
uint32_t VGPRUsage = 0; // The number of VGPRS which has been used
uint32_t SGPRUsage = 0; // The number of SGPRS which has been used
uint32_t LDSMemory = 0; // Used local memory size
uint32_t PDSMemory = 0; // Used private memory size
uint32_t LocalSpill = 0; // Size of SGPR spill to local memory
uint32_t LocalMemoryUse = 0; // Used local memory size
uint32_t PrivateSpill = 0; // Size of VGPR spill to private memory
SubVentusProgramInfo() = default;