This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Implement SIRegisterInfo::getRegPressureSetScore()
AbandonedPublic

Authored by tstellarAMD on Nov 18 2015, 7:44 PM.

Details

Reviewers
escha
arsenm
Summary

This tells the scheduler it is better to increase SGPR register pressure
than VGPR register pressure. This could proably be made smarter in the
future, but this simple implementation yields fairly good results for a
large database of OpenGL shaders:

6462 shaders
Totals:
SGPRS: 320808 -> 300568 (-6.31 %)
VGPRS: 189928 -> 184176 (-3.03 %)
Code Size: 7047556 -> 7069532 (0.31 %) bytes
LDS: 83 -> 83 (0.00 %) blocks
Scratch: 1025024 -> 979968 (-4.40 %) bytes per wave

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to AMDGPU: Implement SIRegisterInfo::getRegPressureSetScore().
tstellarAMD updated this object.
tstellarAMD added a subscriber: llvm-commits.
MatzeB resigned from this revision.Nov 24 2015, 4:27 PM
MatzeB removed a reviewer: MatzeB.

Leave review to people actually knowing AMDGPU.

arsenm added inline comments.Jan 11 2016, 2:30 PM
lib/Target/AMDGPU/SIRegisterInfo.cpp
192–193

I'm not sure what this means.

Also you can move the VGPR test under the SGPR pressure set and remove the second if

getRegPressureSetScore seems to have been removed.

qcolombet resigned from this revision.Feb 10 2016, 5:00 PM
qcolombet removed a reviewer: qcolombet.

Rebased and address some review comments. However, register usage is now worse
with this patch.

With my recent scheduler change, this patch shows improvements again, especially
with Max Waves.

16429 shaders in 3231 tests
Totals:
SGPRS: 311488 -> 308360 (-1.00 %)
VGPRS: 209002 -> 207986 (-0.49 %)
Code Size: 7183656 -> 7297532 (1.59 %) bytes
LDS: 83 -> 83 (0.00 %) blocks
Scratch: 1600512 -> 4276224 (167.18 %) bytes per wave
Max Waves: 49208 -> 50252 (2.12 %)
Wait states: 0 -> 0 (0.00 %)

arsenm edited edge metadata.Mar 31 2016, 2:51 AM

Why is the scratch increase so big?

Is this still needed with your new scheduler passes?

tstellarAMD abandoned this revision.Sep 1 2016, 1:54 PM

Not needed any more after the recent scheduling improvements.