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

Andrew Trick atrick at apple.com
Fri Mar 30 19:43:52 PDT 2012

On Mar 30, 2012, at 7:20 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>> +// 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>.

There are other clients of my pretty interface to be checked in soon. But I'm not attached to my implementation--it's nasty. I was trying to avoid doubling the size of the set. It didn't seem right to do that to a SmallVector. But feel free to change.

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

The subregisters are implicitly added by the "process composites" code. So I needed that ugly case to deal with XMM. Unless we change how getSubRegs work.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120330/0e00f608/attachment.html>

More information about the llvm-commits mailing list