Bug 151146 - Air::spillEverything and Air::iteratedRegisterCoalescing don't take into account Inst::extraClobberedRegs()
Summary: Air::spillEverything and Air::iteratedRegisterCoalescing don't take into acco...
Status: RESOLVED DUPLICATE of bug 151246
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 150279
  Show dependency treegraph
Reported: 2015-11-11 11:48 PST by Filip Pizlo
Modified: 2015-11-16 16:49 PST (History)
10 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-11-11 11:48:08 PST
Both allocators have a loop devoted to ensuring that all Def's interfere with each other.  Inst::extraClobberedRegs() is like an extra set of Def's.

This is important because it's what ensures that we don't put something into a register that is clobbered by a call.
Comment 1 Filip Pizlo 2015-11-11 11:58:09 PST
I think that both allocators want an abstraction like:

    [&] (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<typename Functor>
void forEachTmpIncludingExtra(const Functor& functor)
        [&] (Tmp& tmp, Arg::Role role, Arg::Type type) {
             functor(tmp, role, type);
    if (hasSpecial()) {
            [&] (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.
Comment 2 Benjamin Poulain 2015-11-16 16:49:23 PST
Fixed in https://bugs.webkit.org/show_bug.cgi?id=151246

*** This bug has been marked as a duplicate of bug 151246 ***