diff options
author | Marek Olsak <marek.olsak@amd.com> | 2016-07-13 17:35:15 +0000 |
---|---|---|
committer | Marek Olsak <marek.olsak@amd.com> | 2016-07-13 17:35:15 +0000 |
commit | 0532c190f7b0a8c33fdc20485c23815e2321bd16 (patch) | |
tree | fe55f36ca26b2aecdc9b0ea7172f35ceabacf5da /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | |
parent | 1852a784161c6a61ff1446e267c5e459f2c2a268 (diff) | |
download | bcm5719-llvm-0532c190f7b0a8c33fdc20485c23815e2321bd16.tar.gz bcm5719-llvm-0532c190f7b0a8c33fdc20485c23815e2321bd16.zip |
AMDGPU/SI: Emit the number of SGPR and VGPR spills
Summary:
v2: don't count SGPRs spilled to scratch twice
I think this is sufficient. It doesn't count private memory usage, which
happens often and uses scratch but isn't technically a spill. The private
memory usage can be computed by:
[scratch_per_thread - vgpr_spills - a random multiple of SGPR spills].
The fact SGPR spills add very high numbers to the scratch size make that
computation a guessing game, but I don't have a solution to that.
Reviewers: tstellarAMD
Subscribers: arsenm, kzhuravl
Differential Revision: http://reviews.llvm.org/D22197
llvm-svn: 275288
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h index 33d41926440..f5bd6366c71 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h @@ -85,6 +85,9 @@ private: bool HasNonSpillStackObjects; bool HasFlatInstructions; + unsigned NumSpilledSGPRs; + unsigned NumSpilledVGPRs; + // Feature bits required for inputs passed in user SGPRs. bool PrivateSegmentBuffer : 1; bool DispatchPtr : 1; @@ -313,6 +316,22 @@ public: HasFlatInstructions = UseFlat; } + unsigned getNumSpilledSGPRs() const { + return NumSpilledSGPRs; + } + + unsigned getNumSpilledVGPRs() const { + return NumSpilledVGPRs; + } + + void addToSpilledSGPRs(unsigned num) { + NumSpilledSGPRs += num; + } + + void addToSpilledVGPRs(unsigned num) { + NumSpilledVGPRs += num; + } + unsigned getPSInputAddr() const { return PSInputAddr; } |