1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Add comments. Addressing review comments from Evan on r204690.

llvm-svn: 204864
This commit is contained in:
Manman Ren 2014-03-26 22:14:09 +00:00
parent 769504cd1c
commit 9d8f66d268

View File

@ -2122,6 +2122,11 @@ unsigned RAGreedy::selectOrSplitImpl(LiveInterval &VirtReg,
CSRFirstUse = true;
BlockFrequency CSRCost(CSRFirstTimeCost);
// Using a CSR for the first time has a cost because it causes push|pop
// to be added to prologue|epilogue. Splitting a cold section of the live
// range can have lower cost than using the CSR for the first time;
// Spilling a live range in the cold path can have lower cost than using
// the CSR for the first time.
if (getStage(VirtReg) == RS_Spill && CSRFirstUse && NewVRegs.empty() &&
CSRFirstTimeCost > 0 && VirtReg.isSpillable()) {
// We choose spill over using the CSR for the first time if the spill cost