Displaying 20 results from an estimated 200 matches similar to: "[LLVMdev] runStaticConstructorsDestructors not calling static destructors"
2011 Sep 09
0
[LLVMdev] runStaticConstructorsDestructors not calling static destructors
On Fri, Sep 9, 2011 at 1:36 PM, Graham Wakefield <wakefield at mat.ucsb.edu> wrote:
> Hi there,
>
> I'm having trouble getting ExecutionEngine->runStaticConstructorsDestructors(module, true) to actually trigger static destructors in my code. The static constructors however do get called.
>
> I don't know if this is an LLVM or Clang issue, from looking at the IR (see
2014 Apr 30
4
[LLVMdev] Best way to clean up empty global_ctors
Hi,
I'd like to fix PR19590, which is about llvm.global_ctors containing
functions that end up being empty after optimization (which causes the
linker to add useless init_array entries to the output binary).
globalopt removes empty functions from llvm.global_ctors, but by the
time the function becomes empty globalopt has already run and it
doesn't run again.
I'm wondering what the
2008 Aug 31
1
[LLVMdev] Correct way of JITing multiple modules?
Hi,
I'm trying to work out the correct way of JITing multiple modules.
My original approach was to create a new ExecutionEngine for each
Module, however this generates an assert failure. If I create a new
ModuleProvider for each new Module and then add this to a single
ExecutionEngine then I have a problem with static constructors not
being run. With a single module, I can call
2013 Oct 22
1
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy,
I added the runStaticConstructorsDestructors and FindFunctionNamed
functions. This also required making them virtual in EE.h.
I'm not sure about FindFunctionNamed:
In addition to searching finalized modules, should it search Added and
Loaded modules?
If it finds a Function in these, should it compile and finalize it before
returning the Function* ?
I modified the implementation
2018 Jun 14
3
runStaticConstructorsDestructors() causes crash on exit
Greetings, LLVM wizards.
I am using clang to compile a C++ module, and an ExecutionEngine (MCJIT) to
execute a function it defines. That works (or pretends to). However, if I
call the module's constructors first:
exec_engine->runStaticConstructorsDestructors(false);
exec_engine->runFunctionAsMain(function, argvec, NULL);
execution still works, but my program crashes when it exits, in
2019 Mar 14
2
Static constructors with ORC JIT?
Hi all,
Is there way to tell the ORC JIT infrastructure to run the static constructors in a module that has just been compiled? I see that the ExecutionEngine class has a runStaticConstructorsDestructors function, is that relevant with ORC and if so, how should it be accessed? Thanks, Daniele
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2018 Jun 19
2
runStaticConstructorsDestructors() causes crash on exit
On Alex's advice I am switching from MCJIT to the Orc API to compile and
execute functions. Starting from the new clang-interpreter example in the
source code (top of the tree!), I am able to execute my functions all
right... as long as there are no constructors and destructors to call.
My question: is there a simple way, with the Orc API, to run a module's
constructors and destructors? I
2014 Mar 20
3
[LLVMdev] So what's the deal with debug_frame V eh_frame
While comparing debug info between GCC and Clang I found a section
that only Clang produces and GCC never produces: debug_frame.
It seems (though I haven't verified this with absolute certainty) as
though GCC just always uses eh_frame. LLVM on the other hand sometimes
uses eh_frame and sometimes uses debug_frame.
Here's an example:
int f1();
int i = f1();
void func() { }
Compiled with
2013 Oct 22
2
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy,
Here is the patch. it incorporates:
1) your latest patch to SVN.
2) mcjit-module-state-optimization.patch.
3) the PtrSet changes.
Other than the OwnedModules implementation there were other differences
between 1) and 2), especially in the Finalize* functions, so please review
that I got the right code.
I got bitten by subtle bugs arising from MCJIT inheriting from EE:
First, MCJIT
2019 Mar 15
2
Static constructors with ORC JIT?
Thank you Alex,
I went and implemented a solution along those lines. It works well.
It may be worth mentioning static constructors in the Kaleidoscope tutorial.
Cheers,
Daniele
________________________________________
From: Alex Denisov [1101.debian at gmail.com]
Sent: 15 March 2019 08:07
To: Daniele Vettorel
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] Static constructors with ORC
2018 Jun 21
2
runStaticConstructorsDestructors() causes crash on exit
When OrcMCJITReplacement is given a new module, it asks for the module's
constructors, gives them names like $static_ctor.0, $static_ctor.1, etc.,
and saves the mangled names in a map. Later, to execute them, it uses
runViaLayer(), which looks for those symbol names in the given JIT layer.
Could one not simply execute the constructors straight away, rather than
naming them and looking them up
2013 Oct 22
0
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Yaron,
Overall this looks great.
There are a couple of remaining holes. Specifically, MCJIT inherits implementations of the FindFunctionNamed and runStaticConstructorsDestructors methods from ExecutionEngine which use the old Modules vector, so you'll need to override these in MCJIT. (The implementations are fairly trivial.)
Beyond that I just have a couple of questions.
First,
2011 May 23
1
[LLVMdev] library functions
I see that some of the system header-file definitions have the internal
keyword.
For example,
define internal void @__cxx_global_var_init() section
"__TEXT,__StaticInit,regular,pure_instructions" {
entry:
call void @_ZNSt8ios_base4InitC1Ev(%"class.std::ios_base::Init"*
@_ZStL8__ioinit)
%0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void
2018 Jun 25
2
runStaticConstructorsDestructors() causes crash on exit
Many thanks for the sample code, Alex. In the end I did it the same way
OrcMCJITReplacement does it. Constructors and destructors are called and,
thanks to LocalCXXRuntimeOverrides, the program does not crash on exit! But
it does seem like there should be a simpler way; the learning curve is
steep...
Geoff
On Thu, 21 Jun 2018 at 12:28, Alex Denisov <1101.debian at gmail.com> wrote:
>
2010 Nov 02
1
[LLVMdev] Forcing the Interpreter segfaults
Hi everyone !
I am very new to LLVM and intent to use it in a research project.
I have a problem with the interpreter: I have a simple compiler that
generates LLVM bitcode, JIT it and execute it, and it works very well.
Now I would like to execute it using the interpreter. And I get a segfault.
Here is the code :
// This code JIT the function and executes it
llvm::InitializeNativeTarget();
2011 May 23
0
[LLVMdev] library functions
On 5/23/11 1:05 PM, George Baah wrote:
> Hi,
> I am writing a pass which is supposed to ignore library functions. Is
> there a way to
> distinguish functions declared and defined by a developer from
> non-local functions (library functions)?
> Thanks.
There is no reliable way to do this, but there are several heuristics
that will probably work well in practice.
When
2011 May 23
2
[LLVMdev] library functions
Hi,
I am writing a pass which is supposed to ignore library functions. Is there
a way to
distinguish functions declared and defined by a developer from non-local
functions (library functions)?
Thanks.
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110523/650c7fa4/attachment.html>
2010 Jan 31
1
[LLVMdev] Boehm GC + static variables?
You should look at
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h?view=markup
and see if inheriting from that and overriding allocateGlobal() will
do what you want.
I'm a little surprised the boehm gc doesn't already see the globals,
since there's a reference to their memory from the JMM, but maybe it
doesn't scan mmap regions by
2010 Nov 02
2
[LLVMdev] Forcing the Interpreter segfaults
Helps to send to list:
On Tue, Nov 2, 2010 at 1:00 PM, OvermindDL1 <overminddl1 at gmail.com> wrote:
> On Tue, Nov 2, 2010 at 12:51 PM, Salomon Brys <salomon.brys at gmail.com> wrote:
>> Hi everyone !
>> I am very new to LLVM and intent to use it in a research project.
>> I have a problem with the interpreter: I have a simple compiler that
>> generates LLVM
2009 Jun 22
0
[LLVMdev] X86 JIT
On Jun 22, 2009, at 2:19 PM, Kasra wrote:
> Hi,
>
> for some reason I could not get the machine code generator for x86
> working. The interpreter is the only thing that works, is there
> anything that I am missing here?
This recently changed. In your main program, please #include "llvm/
Target/TargetSelect.h" and call InitializeNativeTarget(); before
setting up