[llvm-dev] Build a Interference Graph

Natanael Ramos via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 18 16:09:05 PST 2015


Good Night.

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:

L1->overlaps(L2)

Where L1 and L2 are two different Live Intervals. Or should I use:

L1->overlaps(RG1)

Where L1 is a Live Interval and RG1 is a RegUnit for an arbitrary physical
register.

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.

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?

I'm using LLVM version 3.6.2.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151118/4e5c6abf/attachment.html>


More information about the llvm-dev mailing list