forked from OSchip/llvm-project
AMDGPU: Don't pass MachineFunction if only the IR Function is used
This commit is contained in:
parent
b4c91462e8
commit
6f09bb7da2
|
@ -1165,7 +1165,7 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
|
|||
S_00B84C_LDS_SIZE(STM.isAmdHsaOS() ? 0 : ProgInfo.LDSBlocks) |
|
||||
S_00B84C_EXCP_EN(0);
|
||||
|
||||
ProgInfo.Occupancy = STM.computeOccupancy(MF, ProgInfo.LDSSize,
|
||||
ProgInfo.Occupancy = STM.computeOccupancy(MF.getFunction(), ProgInfo.LDSSize,
|
||||
ProgInfo.NumSGPRsForWavesPerEU,
|
||||
ProgInfo.NumVGPRsForWavesPerEU);
|
||||
}
|
||||
|
|
|
@ -635,13 +635,12 @@ unsigned GCNSubtarget::getReservedNumSGPRs(const MachineFunction &MF) const {
|
|||
return 2; // VCC.
|
||||
}
|
||||
|
||||
unsigned GCNSubtarget::computeOccupancy(const MachineFunction &MF,
|
||||
unsigned LDSSize,
|
||||
unsigned GCNSubtarget::computeOccupancy(const Function &F, unsigned LDSSize,
|
||||
unsigned NumSGPRs,
|
||||
unsigned NumVGPRs) const {
|
||||
unsigned Occupancy =
|
||||
std::min(getMaxWavesPerEU(),
|
||||
getOccupancyWithLocalMemSize(LDSSize, MF.getFunction()));
|
||||
getOccupancyWithLocalMemSize(LDSSize, F));
|
||||
if (NumSGPRs)
|
||||
Occupancy = std::min(Occupancy, getOccupancyWithNumSGPRs(NumSGPRs));
|
||||
if (NumVGPRs)
|
||||
|
|
|
@ -1100,7 +1100,7 @@ public:
|
|||
/// registers if provided.
|
||||
/// Note, occupancy can be affected by the scratch allocation as well, but
|
||||
/// we do not have enough information to compute it.
|
||||
unsigned computeOccupancy(const MachineFunction &MF, unsigned LDSSize = 0,
|
||||
unsigned computeOccupancy(const Function &F, unsigned LDSSize = 0,
|
||||
unsigned NumSGPRs = 0, unsigned NumVGPRs = 0) const;
|
||||
|
||||
/// \returns true if the flat_scratch register should be initialized with the
|
||||
|
|
|
@ -53,7 +53,7 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
|
|||
FlatWorkGroupSizes = ST.getFlatWorkGroupSizes(F);
|
||||
WavesPerEU = ST.getWavesPerEU(F);
|
||||
|
||||
Occupancy = ST.computeOccupancy(MF, getLDSSize());
|
||||
Occupancy = ST.computeOccupancy(F, getLDSSize());
|
||||
CallingConv::ID CC = F.getCallingConv();
|
||||
|
||||
// FIXME: Should have analysis or something rather than attribute to detect
|
||||
|
|
Loading…
Reference in New Issue