[llvm-dev] Liveness Analysis

Björn Pettersson A via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 26 06:01:08 PDT 2018


So what is the status about LiveVariables. Is there a plan to remove it?

After searching in old lvm-dev-mails it is mentioned that LiveVariable
still exists due to one pass needing it. And a comment in
TargetPassConfig.cpp indicates that the pass in question is
TwoAddressInstruction:

  // FIXME: Once TwoAddressInstruction pass no longer uses kill flags,
  // LiveVariables can be removed completely, and LiveIntervals can be directly
  // computed. (We still either need to regenerate kill flags after regalloc, or
  // preferably fix the scavenger to not depend on them).


When looking in TwoAddressInstructionPass.cpp it looks like the pass only
use/update LV when there is no LIS. And there seems to be an experimental
-early-live-intervals option to calculcate LIS before
TwoAddressInstructionPass.

I also noticed that the -early-live-intervals option was added back in 2012.
So I assume that the plans to replace LiveVariables by LiveIntervals
in TwoAddressInstructionPass got some history.

Has there been any evaluation (lately) from using -early-live-intervals?


I got a feeling that the SSA deconstruction passes are overly complicated
right now, since for example PHIElimination tries to update both LV and
LIS conditionally depending on if the analyses are available or not.
But there are no test cases that set -early-live-intervals afaict, so
there is a bulk of code that seems to not be regression tested related
to LIS in PHIElimination and TwoAddressInstructionPass.

Given that no one is still actively working on removing LiveVariables;
Maybe it is better to remove -early-live-intervals and the not
so well tested code regarding LIS in PHIElimination/TwoAddressInstructionPass.
And then we could say that LiveVariables should be used during SSA
deconstruction (instead of saying that it is deprecated).

/Björn


> -----Original Message-----
> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Matthias
> Braun via llvm-dev
> Sent: den 20 september 2018 22:23
> To: Jason Ott <jott002 at ucr.edu>
> Cc: llvm-dev at lists.llvm.org
> Subject: Re: [llvm-dev] Liveness Analysis
> 
> Assuming you talk about the machine representation:
> - The register allocators use the LiveIntervals analysis (there is also
> LiveVariables but that is deprecated, please don't use it).
> - When register allocation is done we keep the block live-in lists around
> and you can use LivePhysReg or LiveRegUnits to recompute the liveness
> information in the middle of a basic block when necessary.
> - The RDF framework in lib/Target/Hexagon performs a dataflow analysis
> post-regalloc to determine values in physical registers.
> 
> - Matthias
> 
> > On Sep 20, 2018, at 11:31 AM, Jason Ott via llvm-dev <llvm-
> dev at lists.llvm.org> wrote:
> >
> > Where is the liveness analysis pass?  I have been looking for days but
> cannot find anything.
> >
> > I just want to know transfer variables in and out of basic blocks, that
> are calculated using simple data flow equations.
> >
> > Thanks!
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list