[LLVMdev] LiveIntervals invalidates LiveVariables?

Chris Lattner sabre at nondot.org
Wed Sep 7 10:35:42 PDT 2005


On Wed, 7 Sep 2005, Tzu-Chien Chiu wrote:
> I though LiveVariables may be invalidated by LiveIntervals, but it's
> declared not:
>
> void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const
> {
>  AU.addPreserved<LiveVariables>();
>  AU.addRequired<LiveVariables>();
>  ...
>
> LiveInterval may coalesce virtual registers and remove identity moves
> instructions:
>
> bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
>  ...
>  // perform a final pass over the instructions and compute spill
>  // weights, coalesce virtual registers and remove identity moves
>
> but the data structure LiveVariables::VirtRegInfo is _not_ updated.
> That is, VarInfo::DefInstr may point to an invalid (being coalesced)
> instruction.

You're right, that's a bug.  I fixed it here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050905/028156.html

That line dates from when live interval analysis didn't do anything fancy. 
In the default code generator, nothing uses livevar after live intervals, 
so this bug didn't cause any problems.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list