[llvm-commits] [llvm] r153794 - in /llvm/trunk/utils/TableGen: CodeGenRegisters.cpp CodeGenRegisters.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Mar 30 19:20:11 PDT 2012


On Mar 30, 2012, at 6:35 PM, Andrew Trick wrote:

> Author: atrick
> Date: Fri Mar 30 20:35:59 2012
> New Revision: 153794
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=153794&view=rev
> Log:
> Introduce Register Units: Give each leaf register a number.
> 
> First small step toward modeling multi-register multi-pressure. In the
> future, register units can also be used to model liveness and
> aliasing.

Yay!

> +// Merge two RegUnitLists maintining the order and removing duplicates.

Speling.

> +// Overwrites MergedRU in the process.
> +static void mergeRegUnits(CodeGenRegister::RegUnitList &MergedRU,
> +                          const CodeGenRegister::RegUnitList &RRU)

This function does the same as std::set_union from <algorithm>.

> +      // Strangely a register may have itself as a subreg (self-cycle) e.g. XMM.
> +      CodeGenRegister *SR = I->second;
> +      if (SR == this) {
> +        if (RegUnits.empty())
> +          RegUnits.push_back(RegBank.newRegUnit());
> +        continue;
> +      }

I checked X86RegisterInfo.td, and it turns out we don't actually specify XMM0 as a sub-register of itself. Instead, sub_ss and sub_sd are described as idempotent sub-register indexes.

I think it's OK to assume that sub-registers form a DAG.

/jakob



More information about the llvm-commits mailing list