[llvm-dev] Register pressure calculation in the machine scheduler and live-through registers

Jonas Paulsson via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 12 06:44:44 PDT 2017


Hi Ghassan,

> As for live-through information, we found that the machine scheduler 
> does call initLiveThru() and here is a pointer to the code:
>
>
> https://gitlab.com/CSUS_LLVM/LLVM_DRAGONEGG/blob/master/Generic/llvmTip/llvm-master/lib/CodeGen/MachineScheduler.cpp#L921
>
The first part of the comment above initLiveThru() says "The register 
tracker is unaware of global liveness so ignores normallive-thru 
ranges...". It is then of course confusing to see these methods like 
initLiveThru()...

My understanding is that (please correct me if I'm wrong)
1. All instructions are traversed bottom-up during DAG building. While 
doing this reg pressure is tracked based on just looking at those 
instructions. So if a def has no use in an mbb it is a "live-out" reg, 
and if there is a use with no def, it would become "live-in". This is 
then a kind of local live-through concept, in contrast to a true 
live-through analysiswhich would be aware of registers not used/defed in 
the region as well.
2. We should ideally have an analysis of global liveness so that the 
regpressure trackers could be properly initialized, but this is 
currently missing. Of course, one might hope thatit wouldn't be too hard 
to extend LiveIntervals to also provide this information... It would be 
interesting to merely try this and see how valuable it would be...

/Jonas


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


More information about the llvm-dev mailing list