[llvm-commits] [llvm] r157006 - in /llvm/trunk/lib/CodeGen: MachineScheduler.cpp RegisterPressure.cpp RegisterPressure.h

Andrew Trick atrick at apple.com
Wed Aug 15 10:36:09 PDT 2012


On Aug 15, 2012, at 10:07 AM, Sergei Larin <slarin at codeaurora.org> wrote:
> 
>  Are there any examples/documentation on implementing the reg pressure
> hooks for a back end?

Sergei,

The MachineScheduler currently implements register pressure "back-off". It simply prioritizes instructions that don't increase pressure beyond some limit. I can think of a few more sophisticated ways to control pressure but haven't determined yet if they're worth implementing.

Even though back-off is a simple mechanism, the policy can become complicated by how the pressure limit is determined. The current (experimental) policy is implemented in MachineScheduler.cpp compareRPDelta(). The pressure tracker will give you a pressure "delta" between it's current position and some given instruction to-be-scheduled. The delta has three components. You can probably just choose one that makes the most sense for you.

You may also decide whether you care about all "pressure sets" derived from your target description, or you can pick a particular register class that interests you and find the maximal pressure set affected by that class.

The best documentation we have so far are the comments in RegisterPressure.h.  I expect this design to change considerably as we tune performance. I can give you more detailed answers once you have specific questions.

-Andy 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120815/d6ca9468/attachment.html>


More information about the llvm-commits mailing list