Re: JIT compiling with LLVM v9.0 - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: JIT compiling with LLVM v9.0
Date
Msg-id 3f5a73ff-5586-a2cf-c8b3-8ef366a6bcc4@postgrespro.ru
Whole thread Raw
In response to Re: JIT compiling with LLVM v9.0  (Andres Freund <andres@anarazel.de>)
Responses Re: JIT compiling with LLVM v9.0
List pgsql-hackers

On 26.01.2018 11:23, Andres Freund wrote:
> Hi,
>
> Thanks for testing things out!
>
Thank you for this work.
One more question: do you have any idea how to profile JITed code?
There is no LLVMOrcRegisterPerf in LLVM 5, so jit_profiling_support 
option does nothing.
And without it perf is not able to unwind stack trace for generated code.
A attached the produced profile, looks like "unknown" bar corresponds to 
JIT code.

There is NoFramePointerElim option in LLVMMCJITCompilerOptions 
structure, but it requires use of ExecutionEngine.
Something like this:

     mod = llvm_mutable_module(context);
     {
         struct LLVMMCJITCompilerOptions options;
         LLVMExecutionEngineRef jit;
         char* error;
         LLVMCreateExecutionEngineForModule(&jit, mod, &error);
         LLVMInitializeMCJITCompilerOptions(&options, sizeof(options));
         options.NoFramePointerElim = 1;
         LLVMCreateMCJITCompilerForModule(&jit, mod, &options, 
sizeof(options),
                                          &error);
     }
     ...

But you are compiling code using LLVMOrcAddEagerlyCompiledIR
and I find no way to pass no-omit-frame pointer option here.


-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables
Next
From: Emre Hasegeli
Date:
Subject: Re: Redefining inet_net_ntop