On Jan 9, 2008, at 8:44 PM, Owen Anderson wrote: > You really need to address these to Evan. I asked him what to do > for LiveIntervalAnalysis, and this is what he told me :-) > > --Owen > > On Jan 9, 2008, at 10:08 PM, Chris Lattner wrote: > >>> 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.
It does change DefInst. This code is triggered when a two-address instruction redefines a vreg so it can only be triggered for vregs with multiple def's. >> >>> >>> + MachineRegisterInfo& MRI = mbb->getParent()->getRegInfo(); >> >> I think that MRI should become and ivar in liveintervalanalysis. Yes, there is an ivar mri_. >> >>> >>> + 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... Yes, I think it' can probably be simplified. But it's probably correct. This is before coalescing: v1024 = v1025 v1024 = v1024 op ? So there must be two def's of v1024 in the same BB and we want the first one. Evan >> >> -Chris >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits