This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Emit the number of SGPR and VGPR spills
ClosedPublic

Authored by mareko on Jul 10 2016, 6:48 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

mareko updated this revision to Diff 63425.Jul 10 2016, 6:48 AM
mareko retitled this revision from to AMDGPU/SI: Emit the number of SGPR and VGPR spills.
mareko updated this object.
nhaehnle added a subscriber: nhaehnle.

LGTM. Would be good to get a quick feedback on whether the newly emitted config value messes with the HSA expectations though...

LGTM. Would be good to get a quick feedback on whether the newly emitted config value messes with the HSA expectations though...

It's emitted only if (!STM.isAmdHsaOS()). I guess that means "no HSA".

nhaehnle accepted this revision.Jul 13 2016, 4:34 AM
nhaehnle edited edge metadata.

You're right, looks good then.

This revision is now accepted and ready to land.Jul 13 2016, 4:34 AM
This revision was automatically updated to reflect the committed changes.