<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Air::spillEverything and Air::iteratedRegisterCoalescing don't take into account Inst::extraClobberedRegs()"
   href="https://bugs.webkit.org/show_bug.cgi?id=151146#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Air::spillEverything and Air::iteratedRegisterCoalescing don't take into account Inst::extraClobberedRegs()"
   href="https://bugs.webkit.org/show_bug.cgi?id=151146">bug 151146</a>
              from <span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span></b>
        <pre>I think that both allocators want an abstraction like:

inst.forEachTmpIncludingExtra(
    [&amp;] (Tmp tmp, Arg::Role role, Arg::Type type) {
        // tmp is not a reference, since we cannot edit an extraClobberedReg.
    });

This could be implemented as:

template&lt;typename Functor&gt;
void forEachTmpIncludingExtra(const Functor&amp; functor)
{
    forEachTmp(
        [&amp;] (Tmp&amp; tmp, Arg::Role role, Arg::Type type) {
             functor(tmp, role, type);
        });
    if (hasSpecial()) {
        extraClobberedRegs().forEach(
            [&amp;] (Reg reg) {
                functor(Tmp(reg), Arg::Def, reg.isGPR() ? Arg::GP : Arg::FP);
            });
    }
}

Armed with such an abstraction, we could fix the bug by just changing which method the register allocators call when handling Def-to-Def interference.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>