[LLVMdev] MC Register mapping question (MCRegUnitIterator )
Arnold Schwaighofer
arnolds at codeaurora.org
Thu Aug 30 13:20:01 PDT 2012
The code in collectRanges() does:
// Collect ranges for register units. These live ranges are computed on
// demand, so just skip any that haven't been computed yet.
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units)
if (LiveInterval *LI = LIS.getCachedRegUnit(*Units))
collectRanges(MO, LI, Entering, Internal, Exiting, OldIdx);
} else {
// Collect ranges for individual virtual registers.
collectRanges(MO, &LIS.getInterval(Reg),
Entering, Internal, Exiting, OldIdx);
}
As an experiment, you could replace getCachedRegUnit with getRegUnit
(the uncached version) to make verify we don't have a stale state in
the cache.
On Thu, Aug 30, 2012 at 3:01 PM, Sergei Larin <slarin at codeaurora.org> wrote:
> Arnold,
>
> It is not my code per say - this is what is done in
> LiveIntervalAnalysis.cpp collectRanges(), it wants to iterate over "units"
> of D1 (whatever they are assumed to be), but right there it associates them
> with actual physical register live ranges (see the tread below), and it does
> it wrongly. I was trying to pinpoint exactly to where the issue is, but
> there are too many interdependent links in this chain, so I am seeking some
> domain knowledge :)
More information about the llvm-dev
mailing list