[llvm-dev] Mischeduler: Unknown reason for peak register pressure increase

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 14 12:57:45 PDT 2017


Some notes, though I am not sure I completely understand your expectations yet:
- Pressure and the live-out sets are measured in terms of register units. They allow to factor out register aliases/hierarchies. In this case I assume at least one of RAX, EAX, AX is used somewhere so we report the two underlying register units. The debug print may be a bit confusing as we typically choose the lowest registers in the hierarchy as the name of the register units. You can find some information about register units in MCRegisterInfo.h or my dev meeting talk about register hierarchies.
- The register pressure estimates in the scheduler are not absolute; they only capture registers used inside the scheduling region. There may be more values being alive throughout the scheduling region but not used inside the region. The idea is that these are not essential and will probably be spilled outside the loop/region and so shouldn't influence our scheduling decisions. [1]

- Matthias

[1] While this a good assumption for loops, I have seen this go wrong in situations in which an inner loop is composed of more than 1 scheduling region. I plan to change LLVMs strategy to capture all registers used inside the current loop for the tracking at some point.

> On Aug 11, 2017, at 10:56 PM, Kerbow, Austin Michael via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I am working on a project where we are integrating an existing pre-RA scheduler into LLVM and we are trying to match our peak register pressure values with the machine instruction schedulers values while using X86. I am finding some mismatches in test cases like the one attached. The registers "AH" and "AL" are live-out but not live-in and I don't see that they are defined in the block when walking through the operands for these instructions. The peak pressure printouts from ScheduleDAGMILive look like they are accounting for AH and AL being live because the corresponding pressure sets for these register classes are increased. In the mischeduler is there a way to discover that these two registers may be contributing to peak pressure in the block?
> 
> Thanks,
> 
> Austin Kerbow
> 
> 
> 
> 
> 
> 
> 
> <rp_testcase.txt>_______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170814/a4306cf3/attachment.html>


More information about the llvm-dev mailing list