[LLVMdev] NumLoads/NumStores for linearscan?

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Aug 15 18:04:32 PDT 2010

On Aug 15, 2010, at 5:12 PM, Silvio Ricardo Cordeiro wrote:

> Is there a way for me to collect statistics about the number of loads/stores added by the "linearscan" register allocator (just like can be done with the "local" allocator)?  I still haven't grokked very well the interaction between RALinScan and Spiller... Should I add those two statistics to the spiller's class?

RALinearScan asks the Spiller to spill a virtual register. The StandardSpiller passes the request to LiveIntervals::addIntervalsForSpills. Here, the spill and restore points are added to the VirtRegMap. No spill code has been inserted yet. After register allocation completes, VirtRegRewriter inserts the store and load instructions specified in VirtRegMap. 

The counters you are looking for are in VirtRegRewriter.cpp.

We are working on simplifying this for obvious reasons. If you specify -spiller=inline, the InlineSpiller will insert loads and stores immediately. There are currently no statistics counters in InlineSpiller.cpp. Feel free to add some.


More information about the llvm-dev mailing list