[LLVMdev] MC Register mapping question (MCRegUnitIterator )

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Aug 30 14:13:16 PDT 2012


On Aug 30, 2012, at 1:20 PM, Arnold Schwaighofer <arnolds at codeaurora.org> wrote:

> 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.

LIS.getRegUnit() will either return the cached live range or compute it from scratch. That won't help.

It's calling getCachedRegUnit() here because there is no point in updating live ranges that haven't been computed yet.

Sergei, we don't compute live ranges for physical registers any more. Only regunits.

/jakob




More information about the llvm-dev mailing list