[Beignet] [PATCH] GBE: Implement liveness dump.

Song, Ruiling ruiling.song at intel.com
Thu Sep 24 00:50:16 PDT 2015


Yes, I agree with you.
When I was drafting the patch, I think the old printf code may be still useful for debugging.
But I take a detailed look, the dump to ostream can replace the old debug printf. I will remove old code in V2.

Thanks!
Ruiling
> -----Original Message-----
> From: Zhigang Gong [mailto:zhigang.gong at linux.intel.com]
> Sent: Thursday, September 24, 2015 12:40 PM
> To: Song, Ruiling
> Cc: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH] GBE: Implement liveness dump.
> 
> LGTM, and you can remove those useless printf code now.
> 
> On Thu, Sep 24, 2015 at 10:05:07AM +0800, Ruiling Song wrote:
> > Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> > ---
> >  backend/src/ir/liveness.cpp | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/backend/src/ir/liveness.cpp b/backend/src/ir/liveness.cpp
> > index c5a6374..62a95ea 100644
> > --- a/backend/src/ir/liveness.cpp
> > +++ b/backend/src/ir/liveness.cpp
> > @@ -273,6 +273,26 @@ namespace ir {
> >  #endif
> >     }
> >
> > +  std::ostream &operator<< (std::ostream &out, const Liveness &live) {
> > +    const Function &fn = live.getFunction();
> > +    fn.foreachBlock([&] (const BasicBlock &bb) {
> > +      out << std::endl;
> > +      out << "Label $" << bb.getLabelIndex() << std::endl;
> > +      const Liveness::BlockInfo &bbInfo = live.getBlockInfo(&bb);
> > +      out << "liveIn:" << std::endl;
> > +      for (auto &x: bbInfo.upwardUsed) {
> > +        out << x << " ";
> > +      }
> > +      out << std::endl << "liveOut:" << std::endl;
> > +      for (auto &x : bbInfo.liveOut)
> > +        out << x << " ";
> > +      out << std::endl << "varKill:" << std::endl;
> > +      for (auto &x : bbInfo.varKill)
> > +        out << x << " ";
> > +      out << std::endl;
> > +    });
> > +    return out;
> > +  }
> >
> >    /*! To pretty print the livfeness info */
> >    static const uint32_t prettyInsnStrSize = 48;
> > --
> > 2.3.1
> >
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list