similar to: [LLVMdev] Global constructors "get lost" when transforming bitcode files

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] Global constructors "get lost" when transforming bitcode files"

2019 Dec 19
2
Moving to ORCv2 - Where are my global constructors and destructors?
Heyho, Recently I tried out the ORCv2 JIT, especially the LLJIT. I gotta say, that I really like the new interface and the way you use it! However there is one thing I'm missing. I wrote a small bit code file, which should force having a global constructor. int wuff(); __declspec(noinline) int miau() { printf("Huhuhu"); return wuff(); } const int x = miau(); When I
2010 Apr 11
1
[LLVMdev] llvm.global_ctors and other "appending linkage" global variables?
Can anyone explain how llc translates "appending linkage" global variables like llvm.global_ctors into assembly? In the case I am examining, the global_ctor variables are in multiple bitcode object modules produced by the llvm compiler as arrays of pointers. As documented, the arrays seem to be combined when the different bitcode object modules are linked into one, so now there is one
2013 Jul 30
1
[LLVMdev] Weird error from Undefined Sanitizer
# Everything is done on Mac OS X 10.8.4, with llvm/clang/libc++/libc++abi built from source this morning # totclang is an alias for the built clang. $ export LLVM=/Sources/LLVM $ export LIBCXX=$LLVM/libcxx $ export LIBCXXABI=$LLVM/libcxxabi $ totclang -std=c++11 -stdlib=libc++ -I $LIBCXX/include -fsanitize=undefined ubsan.cpp -L $LIBCXX/lib -L $LIBCXXABI/lib -lc++abi $
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
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 Jan 31
0
[LLVMdev] Boehm GC + static variables?
I've implemented this by adding calls to GC_add_roots(<first global in module>,<last global in module>+1) to the llvm.global_ctors before any other static initialization code for the module. This should be safe assuming that: - global variables are laid out in memory in the order they appear in their module (and ideally contiguously without being interleaved with any other values)
2014 May 01
2
[LLVMdev] Best way to clean up empty global_ctors
On Thu, May 1, 2014 at 11:12 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote: > On 1 May 2014 14:08, Reid Kleckner <rnk at google.com> wrote: >> I talked about this with Nick in person months ago, and my understanding is >> that GlobalOpt is also an enabling optimization that needs to run early. >> For example, if we can eliminate an initializer to an
2013 Sep 04
0
[LLVMdev] Proposal: Adding an optional association field to llvm.global_ctors
Hi Reid, On 03/09/13 20:08, Reid Kleckner wrote: > On Mon, Sep 2, 2013 at 5:18 AM, Duncan Sands <baldrick at free.fr > <mailto:baldrick at free.fr>> wrote: > > Hi Reid, > > On 26/08/13 23:43, Reid Kleckner wrote: > > To implement http://llvm.org/PR16959 > <http://llvm.org/bugs/show___bug.cgi?id=16959 >
2014 Jul 31
2
[LLVMdev] Inconsistent third field in global_ctors (was Re: [llvm] r214321 - UseListOrder: Visit global values)
> On 2014-Jul-31, at 10:07, Reid Kleckner <rnk at google.com> wrote: > >> On Thu, Jul 31, 2014 at 9:49 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote: >> Hold on, I'm still not sure what kind of guarantees (restrictions) the C >> API imposes. >> >> If I implement (2), then -verify will fail if someone (e.g.) adds >>
2016 Sep 20
2
-sanitizer-coverage-prune-blocks=true and LibFuzzer
Hello LLVM devs, I'm running lots of experiments with LibFuzzer these days -- it's an amazing tool! I've noticed something weird while examining the effect of various coverage options: for one of my benchmarks, the fuzzer was achieving a higher total coverage before April 2016, when -sanitizer-coverage-prune-blocks became true by default (commit
2014 May 01
3
[LLVMdev] Best way to clean up empty global_ctors
I talked about this with Nick in person months ago, and my understanding is that GlobalOpt is also an enabling optimization that needs to run early. For example, if we can eliminate an initializer to an internal global with no other stores to it, we can propagate the result. Maybe we should run it twice. On Thu, May 1, 2014 at 11:01 AM, Rafael Espíndola < rafael.espindola at gmail.com>
2014 Apr 07
2
[LLVMdev] Loop unswitching creates dead code
Hi, I'm surprised by the result of compiling the following lines of code: for (int i = 0; i < RANDOM_CHUNKS; i++) { for (int j = 0; j < RANDOM_CHUNK_SIZE; j++) { random_text[i][j] = (int)(ran()*256); } } The problem happens when -fsanitize=undefined, -fno-sanitize-recover and -O3 are enabled. In this case, UndefinedBehaviorSanitizer inserts check for array index out of
2014 Jul 31
2
[LLVMdev] Inconsistent third field in global_ctors (was Re: [llvm] r214321 - UseListOrder: Visit global values)
> On 2014-Jul-30, at 18:05, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote: > >> On 2014-Jul-30, at 17:19, Reid Kleckner <rnk at google.com> wrote: >> >>> On Wed, Jul 30, 2014 at 3:46 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote: >>>> Looking a little deeper, it's not "old-style" exactly; rejecting this
2013 Sep 03
2
[LLVMdev] Proposal: Adding an optional association field to llvm.global_ctors
On Mon, Sep 2, 2013 at 5:18 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Reid, > > On 26/08/13 23:43, Reid Kleckner wrote: > >> To implement http://llvm.org/PR16959 >> <http://llvm.org/bugs/show_**bug.cgi?id=16959<http://llvm.org/bugs/show_bug.cgi?id=16959>>, >> I need to add a new field to >> >> global_ctors. >> >>
2011 Aug 09
3
[LLVMdev] Adding a module in a pass
I have an optimization pass (FunctionPass) where I need to add global constructors. For cleaness sake I decided to add these in my own module. My module is created in my FunctionPass constructor: MyPass() : FunctionPass(ID), myModule("my_module", getGlobalContext()) {} I generate an llvm.global_ctor global variable in my module, and I add my global constructors
2017 Jun 20
2
JIT, LTO and @llvm.global_ctors: Looking for advise
Thanks Peter, this is very useful feedback. I did manage to change the behavior of LinkOnlyNeeded to correctly import all variables with AppendingLinkage. In fact, I discovered that there was already something fishy. A variable with AppendingLinkage would get imported correctly from the source module if the destination module already contained a definition for that variable and wouldn't be
2013 Aug 26
2
[LLVMdev] Proposal: Adding an optional association field to llvm.global_ctors
To implement http://llvm.org/PR16959<http://llvm.org/bugs/show_bug.cgi?id=16959>, I need to add a new field to global_ctors. Static data members of class template instantiations can have initializers that must only run once on program startup. Itanium solves this with guard variables and the emission of multiple initializers, only one of which actually initializes the data at runtime.
2009 Mar 31
0
[LLVMdev] Mutating the elements of a ConstantArray
On Mar 31, 2009, at 4:42 PM, Nick Johnson wrote: > Hello, > > I need to append something to the global "llvm.global_ctors". This > variable may or may not already be declared within the current module. > > If I lookup the global variable, I see that it supports a > getOperand(i) and setOperand(i,c), but does not support any way that I > can enlarge that array to
2017 Jun 20
2
JIT, LTO and @llvm.global_ctors: Looking for advise
Thanks for the hindsight. I am currently working on a patch/potential fix which introduces a new Linker::ImportIntrinsicGlobalVariables flag. The patch includes a unit test reproducing the problem. Hopefully, that will help getting more feedback. Note that it might take a while before I am allowed to upload the patch since I need approval from Autodesk Legal department. Cheers, Benoit Benoit
2012 Sep 10
3
[LLVMdev] Question about ctors, dtors and sections on Windows
Hello all! I extended the LDC2 with a pragma to register a funcion in the llvm.global_ctors or llvm.global_dtors list. On Linux, references to these functions are placed in .ctors and .dtors sections and everything runs fine. On Windows, functions from llvm.global_ctors are placed in section .CRT$XCU, which is automatically called by the MS C Runtime. However, functions from