I understand the mechanics. I don't know why a lesser weight is better than a greater weight. On Thu, Oct 28, 2010 at 7:22 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:> > On Oct 28, 2010, at 4:05 PM, Jeff Kunkel wrote: > >> I was studying the basic register allocator, and I am wondering why >> "LessSpillWeightPriority" priority was used over the greater weight. > > Because the front of std::priority_queue is the largest element given the ordering. > > >
Let me rephrase my question. The live intervals have a weight associated with them. What does this weight exactly represent? Thanks Jeff Kunkel On Thu, Oct 28, 2010 at 7:41 PM, Jeff Kunkel <jdkunk3 at gmail.com> wrote:> I understand the mechanics. I don't know why a lesser weight is better > than a greater weight. > > > On Thu, Oct 28, 2010 at 7:22 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote: >> >> On Oct 28, 2010, at 4:05 PM, Jeff Kunkel wrote: >> >>> I was studying the basic register allocator, and I am wondering why >>> "LessSpillWeightPriority" priority was used over the greater weight. >> >> Because the front of std::priority_queue is the largest element given the ordering. >> >> >> >
Jakob Stoklund Olesen
2010-Oct-28 23:55 UTC
[LLVMdev] [LLVMDev] The Basic Register allocator
On Oct 28, 2010, at 4:46 PM, Jeff Kunkel wrote:> Let me rephrase my question. The live intervals have a weight > associated with them. What does this weight exactly represent?Approximately: spill cost / live range area, see CalcSpillWeights.cpp A higher spill weight is more desirable to keep in a register, so those registers are allocated first.