[Mesa-dev] [PATCH 2/7] clover: Dump the OpenCL C code earlier

EdB edb+mesa at sigluy.net
Fri Dec 19 13:21:59 PST 2014


On Friday, December 19, 2014 01:08:31 PM Tom Stellard wrote:
> On Sun, Dec 14, 2014 at 11:31:22AM +0100, EdB wrote:
> > ---
> > 
> >  src/gallium/state_trackers/clover/llvm/invocation.cpp | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > b/src/gallium/state_trackers/clover/llvm/invocation.cpp index
> > 10dbe08..510e195 100644
> > --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > @@ -709,6 +709,9 @@ clover::compile_program_llvm(const compat::string
> > &source,> 
> >     llvm_ctx.setDiagnosticHandler(diagnostic_handler, &r_log);
> >  
> >  #endif
> > 
> > +   if (debug_flags & DBG_CLC)
> > +      debug_log(source, ".cl");
> > +
> 
> Why do we need to do this?  Could you add an explanation to the commit
> message?

When the code failed to compile, I found it easier to looks at what we try to 
compile with DBG_CLC on.
I moved it before because some time llvm assert or clover raise an exception 
and I wasn't having any dump;

> >     // The input file name must have the .cl extension in order for the
> >     // CompilerInvocation class to recognize it as an OpenCL source file.
> >     llvm::Module *mod = compile_llvm(llvm_ctx, source, headers,
> >     "input.cl",
> > 
> > @@ -719,9 +722,6 @@ clover::compile_program_llvm(const compat::string
> > &source,> 
> >     optimize(mod, optimization_level, kernels);
> > 
> > -   if (debug_flags & DBG_CLC)
> > -      debug_log(source, ".cl");
> > -
> > 
> >     if (debug_flags & DBG_LLVM) {
> >     
> >        std::string log;
> >        llvm::raw_string_ostream s_log(log);



More information about the mesa-dev mailing list