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

Zhigang Gong zhigang.gong at linux.intel.com
Sun Sep 20 21:23:47 PDT 2015


On Mon, Sep 21, 2015 at 02:51:26AM +0000, Song, Ruiling wrote:
> > +
> > +  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.
The replacing of "from --> to" indicates "to" has multiple definitions.
We use definedPhiRegs to track such type of values and avoid to treat
them as uniform latter. It's a little bit hacky and we may need to
re-write the uniform analysis completely in the future. But for now,
I prefer to keep it as is.

Thanks,
Zhigang Gong. 

> 
> Thanks!
> Ruiling
> 
> > +          bb->definedPhiRegs.insert(to);
> > +        }
> > +        if (info.upwardUsed.contains(from)) {
> > +          info.upwardUsed.erase(from);
> > +          info.upwardUsed.insert(to);
> > +        }
> > +      }
> > +    }
> > +  }
> > +
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list