<p dir="ltr">Good Night. </p>
<p dir="ltr">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:</p>
<p dir="ltr">L1->overlaps(L2)</p>
<p dir="ltr">Where L1 and L2 are two different Live Intervals. Or should I use:</p>
<p dir="ltr">L1->overlaps(RG1)</p>
<p dir="ltr">Where L1 is a Live Interval and RG1 is a RegUnit for an arbitrary physical register. </p>
<p dir="ltr">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. </p>
<p dir="ltr">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? </p>
<p dir="ltr">I'm using LLVM version 3.6.2.</p>