[Beignet] [PATCH 3/5] GBE: add two helper routines for liveness partially update.

Song, Ruiling ruiling.song at intel.com
Sun Sep 20 19:51:26 PDT 2015


> +
> +  void Liveness::replaceRegs(const map<Register, Register> &replaceMap)
> + {
> +
> +    for (auto &pair : liveness) {
> +      BlockInfo &info = *pair.second;
> +      BasicBlock *bb = const_cast<BasicBlock *>(&info.bb);
> +      for (auto &pair : replaceMap) {
> +        Register from = pair.first;
> +        Register to = pair.second;
> +        if (info.liveOut.contains(from)) {
> +          info.liveOut.erase(from);
> +          info.liveOut.insert(to);
Why do we need to insert into definedPhiRegs ? other parts LGTM.

Thanks!
Ruiling

> +          bb->definedPhiRegs.insert(to);
> +        }
> +        if (info.upwardUsed.contains(from)) {
> +          info.upwardUsed.erase(from);
> +          info.upwardUsed.insert(to);
> +        }
> +      }
> +    }
> +  }
> +



More information about the Beignet mailing list