diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-03-26 22:14:09 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-03-26 22:14:09 +0000 |
commit | 14aa891976488f3cd202cf2d386236d6a8855cfa (patch) | |
tree | 0ab2fef37b35dd9170a8a80219255153df6164be /llvm/lib | |
parent | 95e0a7058194a50fa99dcc67e4721130ee94fbff (diff) | |
download | bcm5719-llvm-14aa891976488f3cd202cf2d386236d6a8855cfa.tar.gz bcm5719-llvm-14aa891976488f3cd202cf2d386236d6a8855cfa.zip |
Add comments. Addressing review comments from Evan on r204690.
llvm-svn: 204864
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 3a4ad620d07..a4f6b682a23 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -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 |