This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Set a cost model for vgpr registers.
ClosedPublic

Authored by cdevadas on Mar 19 2020, 12:04 AM.

Details

Summary

Apart from the argument registers, set the CostPerUse
value as per the ratio reg_index/allocation_granularity.
It is a pre-commit for introducing the scratch registers
in the ABI. This change should help in a balanced
register allocation.

Diff Detail

Event Timeline

cdevadas created this revision.Mar 19 2020, 12:04 AM
arsenm accepted this revision.Mar 19 2020, 2:42 PM

LGTM except don't call it a cost model in the final commit message, it's just the cost

llvm/lib/Target/AMDGPU/SIRegisterInfo.td
220

Capitalize

This revision is now accepted and ready to land.Mar 19 2020, 2:42 PM
This revision was automatically updated to reflect the committed changes.
piotr added a subscriber: piotr.Apr 20 2020, 1:46 PM

The patch has caused vgpr count to go up significantly in real-world graphics content. Agreed with @cdevadas to revert for now.