> URL: http://llvm.org/viewvc/llvm-project?rev=45815&view=rev > Log: > Don't use LiveVariables::VarInfo::DefInst.
Cool, question though: > +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jan 9 > 21:12:54 2008 > @@ -309,7 +309,14 @@ > // are actually two values in the live interval. Because of > this we > // need to take the LiveRegion that defines this register and > split it > // into two values. > - unsigned DefIndex = > getDefIndex(getInstructionIndex(vi.DefInst)); In the old code, when it introduces multiple definitions of a vreg, did it clear DefInst? If so, this code can only be triggered for vregs with a single def. > > + MachineRegisterInfo& MRI = mbb->getParent()->getRegInfo(); I think that MRI should become and ivar in liveintervalanalysis. > > + unsigned lowIndex = ~0U; > + for (MachineRegisterInfo::def_iterator DI = > MRI.def_begin(interval.reg), > + DE = MRI.def_end(); DI != DE; ++DI) > + if (getInstructionIndex(&*DI) < lowIndex) > + lowIndex = getInstructionIndex(&*DI); > + > + unsigned DefIndex = getDefIndex(lowIndex); It would be really nice if you could drop the loop. It's unclear why it's right anyway, the numbering is not necessarily contiguous across code... -Chris _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits