<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 30, 2012, at 7:20 PM, Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>> wrote:</div><blockquote type="cite"><div><font color="#000000"><br></font><blockquote type="cite">+// Overwrites MergedRU in the process.<br>+static void mergeRegUnits(CodeGenRegister::RegUnitList &MergedRU,<br>+                          const CodeGenRegister::RegUnitList &RRU)<br></blockquote><br>This function does the same as std::set_union from <algorithm>.<br></div></blockquote><div><br></div><div>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.</div><br><blockquote type="cite"><div><br><blockquote type="cite">+      // Strangely a register may have itself as a subreg (self-cycle) e.g. XMM.<br>+      CodeGenRegister *SR = I->second;<br>+      if (SR == this) {<br>+        if (RegUnits.empty())<br>+          RegUnits.push_back(RegBank.newRegUnit());<br>+        continue;<br>+      }<br></blockquote><br>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.<br></div></blockquote></div><br><div>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.</div><div><br></div><div>-Andy</div></body></html>