6 Commits

Author SHA1 Message Date
Janek van Oirschot
50866e84d1
Revert "[AMDGPU] Avoid resource propagation for recursion through multiple functions" (#112013)
Reverts llvm/llvm-project#111004
2024-10-11 17:10:28 +01:00
Janek van Oirschot
67160c5ab5
[AMDGPU] Avoid resource propagation for recursion through multiple functions (#111004)
Avoid constructing recursive MCExpr definitions when multiple functions
cause a recursion.

Fixes #110863
2024-10-11 16:42:50 +01:00
Janek van Oirschot
e35319524a
[AMDGPU] Fix stack size metadata for functions with direct and indirect calls (#110828)
When a function has an external call, it should still use the stack
sizes of direct, known, calls to calculate its own stack size
2024-10-02 14:52:52 +01:00
Thomas Symalla
b95d50e5d8
Add and call AMDGPUMCResourceInfo::reset method (#110818)
When compiling multiple pipelines, the `MCRegisterInfo` instance in
`AMDGPUAsmPrinter` gets re-used even after finalization, so it calls
`finalize()` multiple times.

Add a reset method and call it in
`AMDGPUAsmPrinter::doFinalization`.

Different approach would be to make it a `unique_ptr`.

---------

Co-authored-by: Thomas Symalla <tsymalla@amd.com>
2024-10-02 14:17:01 +02:00
Jie Fu
82e594a022 [AMDGPU] Remove unused lambda capture in AMDGPUMCResourceInfo.cpp (NFC)
/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp:26:16:
error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto GOCS = [this, FuncName, &OutContext](StringRef Suffix) {
               ^~~~~
/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp:64:27:
error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto assignMaxRegSym = [this, &OutContext](MCSymbol *Sym, int32_t RegCount) {
                          ^~~~~
2 errors generated.
2024-09-30 19:07:42 +08:00
Janek van Oirschot
c897c13dde
[AMDGPU] Convert AMDGPUResourceUsageAnalysis pass from Module to MF pass (#102913)
Converts AMDGPUResourceUsageAnalysis pass from Module to MachineFunction
pass. Moves function resource info propagation to to MC layer (through
helpers in AMDGPUMCResourceInfo) by generating MCExprs for every
function resource which the emitters have been prepped for.

Fixes https://github.com/llvm/llvm-project/issues/64863
2024-09-30 11:43:34 +01:00