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

Zhigang Gong zhigang.gong at linux.intel.com
Wed Sep 23 21:39:54 PDT 2015


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