|
18 | 18 | #include "AMDGPUPTNote.h" |
19 | 19 | #include "SIDefines.h" |
20 | 20 | #include "llvm/BinaryFormat/ELF.h" |
21 | | -#include "llvm/CodeGen/MachineFunction.h" |
22 | 21 | #include "llvm/IR/Constants.h" |
23 | 22 | #include "llvm/IR/Module.h" |
24 | 23 | #include "llvm/Support/AMDGPUMetadata.h" |
@@ -242,30 +241,28 @@ void AMDGPUPALMetadata::setScratchSize(CallingConv::ID CC, unsigned Val) { |
242 | 241 | } |
243 | 242 |
|
244 | 243 | // Set the stack frame size of a function in the metadata. |
245 | | -void AMDGPUPALMetadata::setFunctionScratchSize(const MachineFunction &MF, |
246 | | - unsigned Val) { |
247 | | - auto Node = getShaderFunction(MF.getFunction().getName()); |
| 244 | +void AMDGPUPALMetadata::setFunctionScratchSize(StringRef FnName, unsigned Val) { |
| 245 | + auto Node = getShaderFunction(FnName); |
248 | 246 | Node[".stack_frame_size_in_bytes"] = MsgPackDoc.getNode(Val); |
249 | 247 | } |
250 | 248 |
|
251 | 249 | // Set the amount of LDS used in bytes in the metadata. |
252 | | -void AMDGPUPALMetadata::setFunctionLdsSize(const MachineFunction &MF, |
253 | | - unsigned Val) { |
254 | | - auto Node = getShaderFunction(MF.getFunction().getName()); |
| 250 | +void AMDGPUPALMetadata::setFunctionLdsSize(StringRef FnName, unsigned Val) { |
| 251 | + auto Node = getShaderFunction(FnName); |
255 | 252 | Node[".lds_size"] = MsgPackDoc.getNode(Val); |
256 | 253 | } |
257 | 254 |
|
258 | 255 | // Set the number of used vgprs in the metadata. |
259 | | -void AMDGPUPALMetadata::setFunctionNumUsedVgprs(const MachineFunction &MF, |
| 256 | +void AMDGPUPALMetadata::setFunctionNumUsedVgprs(StringRef FnName, |
260 | 257 | unsigned Val) { |
261 | | - auto Node = getShaderFunction(MF.getFunction().getName()); |
| 258 | + auto Node = getShaderFunction(FnName); |
262 | 259 | Node[".vgpr_count"] = MsgPackDoc.getNode(Val); |
263 | 260 | } |
264 | 261 |
|
265 | 262 | // Set the number of used vgprs in the metadata. |
266 | | -void AMDGPUPALMetadata::setFunctionNumUsedSgprs(const MachineFunction &MF, |
| 263 | +void AMDGPUPALMetadata::setFunctionNumUsedSgprs(StringRef FnName, |
267 | 264 | unsigned Val) { |
268 | | - auto Node = getShaderFunction(MF.getFunction().getName()); |
| 265 | + auto Node = getShaderFunction(FnName); |
269 | 266 | Node[".sgpr_count"] = MsgPackDoc.getNode(Val); |
270 | 267 | } |
271 | 268 |
|
|
0 commit comments