[LLVMdev] SSI in LLVM

Eli Friedman eli.friedman at gmail.com
Fri May 15 12:39:48 PDT 2009


On Fri, May 15, 2009 at 10:27 AM, Andre Tavares <andrelct at dcc.ufmg.br> wrote:
> 1) I want to implement a very modular design. In this way, I will have
> an analysis that receives the intervals produced by
> LiveIntervalAnalysis, plus a list of variables, and creates a new set of
> intervals, so that each interval designates a new virtual variable, that
> is visible only inside my analysis. These variables have the SSI
> property. In this way, it is possible to map constraints such as (a >
> 10) to an interval.

I would suggest writing the SSI pass to do some active transformations
rather than providing virtual variables.  You can use dummy PHI nodes
to rename a variable.  That seems a lot more straightforward than
trying to provide virtual names for a value at multiple places in the
program: this way, a variable always represents itself without any
special lookups.  In any case, I don't think  you need liveness
information to compute SSI form, so I don't see the need for
LiveIntervalAnalysis.

> I would like to have critics on this approach so it can be well thought
> before implementation to reduce reimplementation. In particular, to use
> this technique, my analysis must work at the MachineFunction level, as
> it must run after LiveIntervalAnalysis. Do I miss essential information
> at this level, compared to the Function level? I mean, is it possible to
> analysis conditionals to discover things like a > 10, or a == 10, etc?

Working at the MachineFunction level is really late; this sort of
analysis should be working at the IR level.  If you really need
liveness information, I'd suggest writing a new IR-level pass for it;
computing liveness on SSA form isn't very difficult.

-Eli



More information about the llvm-dev mailing list