<p dir="ltr">Ok. Thank you for your help. </p>
<div class="gmail_quote">Em 18/11/2015 10:50 PM, "Matthias Braun" <<a href="mailto:mbraun@apple.com">mbraun@apple.com</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">See MCRegisterInfo.h has a description on what register units are, they are an abstraction over physical registers to speedup complicate subregister structures.<br>
<br>
> On Nov 18, 2015, at 4:41 PM, Natanael Ramos <<a href="mailto:naelr8@gmail.com">naelr8@gmail.com</a>> wrote:<br>
><br>
> Ok, just to clarify, RegUnits, as far I understand, are Physical registers or alias to Physical registers. They exist because some instructions  use physical registers directly rather than virtual register. It's right?<br>
><br>
> And why this RegUnits should be present in the Interference Graph? I thought were only the Live Intervals would be the nodes of the graph.<br>
><br>
> Sorry about the trouble to understand my question, my English doesn't help that much, I'm from Brazil.<br>
><br>
> Em 18/11/2015 10:19 PM, "Matthias Braun" <<a href="mailto:mbraun@apple.com">mbraun@apple.com</a>> escreveu:<br>
> I'm not sure I completely understand what you want here. But I think this is how you would build a traditional register allocation interference graph:<br>
><br>
> Register Units are the things the allocator assigns, I would think it would look something like:<br>
> - Add a node for each register unit and pre-color it!<br>
> - Add a node for each vreg.<br>
> - Then pair up: Each vreg against other vregs with overlapping register classes, each vreg against each register unit contained in the vregs register class.<br>
>     If there is a liverange overlaps add an edge.<br>
><br>
> - Matthias<br>
><br>
> > On Nov 18, 2015, at 4:09 PM, Natanael Ramos via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> ><br>
> > Good Night.<br>
> ><br>
> > I'm implementing a Interference Graph in the Register Allocation pass. I'm building this graph BEFORE any assignment of a virtual register to physical register.  But I have a doubt about how to check the interference between two Live Intervals (i.e. They live at same point), should I use:<br>
> ><br>
> > L1->overlaps(L2)<br>
> ><br>
> > Where L1 and L2 are two different Live Intervals. Or should I use:<br>
> ><br>
> > L1->overlaps(RG1)<br>
> ><br>
> > Where L1 is a Live Interval and RG1 is a RegUnit for an arbitrary physical register.<br>
> ><br>
> > I saw this second method in the PBQP allocator code, I think that maybe will be related to avoid allocation to reserved physical registers or for a on-the-fly check for interference, but the LiveRegMatrix already do that.<br>
> ><br>
> > So my question is: Considering that I will build this interference graph before any assignment (with information only about the Liveness Analisys) and I freeze all reserved physical registers before perform register allocation, should I use the first or the second method? If the second is the right one, why is that?<br>
> ><br>
> > I'm using LLVM version 3.6.2.<br>
> ><br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
<br>
</blockquote></div>