similar to: [LLVMdev] ideas for TLS implementation

Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] ideas for TLS implementation"

2007 Apr 11
0
[LLVMdev] ideas for TLS implementation
Hi Lauro, On Wed, 2007-04-11 at 15:15 -0300, Lauro Ramos Venancio wrote: > For everyone understand which code must be emitted to implement TLS, I > will paste the code generated by gcc for a simple function: ... snip ... This proposal sounds really good to me. I only have a couple comments. We have a "section" keyword already developed in LLVM assembly. Perhaps instead of
2007 Jan 05
2
[LLVMdev] constant pool in large functions
I'm facing a problem with constant pool in large functions. The LLVM prints constant pool at the beginning of functions. In large functions loads can be far from constant pool. GCC resolves this situations by spreading constants throughtout functions. A C test and the code generated by LLVM and GCC are attached. As you can see in the following error the ldr is too far from constant: $
2012 Jul 04
1
[LLVMdev] About thread_local in 3.0
Hi LLVM, I am using 3.0, and I have a question about the __thread in c and thread_local in LLVM IR: O1-O4 and the final linked code behave differently. //////////////////////////////////// The following C code is from the LLVM testcase (SingleSource/UnitTests/Threads/2010-12-08-tls.c) #include <stdio.h> __thread int a = 4; int foo (void) { return a; } int main (void) {
2010 Jul 07
0
[LLVMdev] LLC Bug x86 with thread local storage
On 07/07/2010 08:20 PM, Eric Christopher wrote: > > On Jul 7, 2010, at 4:52 AM, Patrick Marlier wrote: > >> Which one is correct ? >> - movl $tm_nest_level at TPOFF, %ecx >> or >> - movq $tm_nest_level at TPOFF, %rcx >> or >> - movl tm_nest_level at TPOFF, %ecx >> > > I believe this is initial exec and so from: > >
2011 Dec 06
0
[LLVMdev] Implement implicit TLS on Windows - need advice
On Sun, Dec 4, 2011 at 9:18 AM, Kai <kai at redstar.de> wrote: > Hi! > > LLVM currently does not implement the implicit TLS model on Windows. This > model is easy: > > - a thread local variable ends up in the .tls section > - to access a thread local variable, you have to do >  (1) load pointer to thread local storage from TEB >      On x86_64, this is gs:0x58, on
2007 Jan 05
0
[LLVMdev] constant pool in large functions
Hi Lauro, This is a very tricky problem to resolve. Basically you need a pass just before code emission to find the proper locations for each constant pool. That means you need: 1. Exact size of each instruction. This can be added with a custom instrinfo that specify instruction length for each target instruction. 2. Probably some kind of constantpool pseudo instruction. The pass can then
2010 May 13
2
[LLVMdev] Handling of thread_local globals by llc -march=cpp
Hi all, I've been exploring thread local globals in llvm and as part of this investigation I ran llc -march=cpp over a trivial llvm bc file which uses thread local storage for a global. For some reason llc -march=cpp seems to ignore the thread_local and produce code to create a standard global. Is this expected behaviour, a known limitation, or otherwise? Thanks in advance. Details are as
2012 Aug 08
1
[LLVMdev] clang thread-local compilation error on windows
Hello, I am trying to compile some code to LLVM IR with a simple "__thread int x" but hitting this error: test.cpp:1:1: error: thread-local storage is unsupported for the current target I'm using both the -S and -emit-llvm options on clang, and was expecting to see "@x = thread_local global i32 0" come out of clang. I am curious why clang even cares about this since
2010 May 13
0
[LLVMdev] Handling of thread_local globals by llc -march=cpp
I note also that this is not a currently unsupported target case where an error should/could/would be produced on attempting to emit code with thread local references. I say this because clang is able to compile both c source with __thread on a global and bc containing a @variable = thread_local global ... and a function that references the thread local global variable to both assembly and machine
2010 May 13
1
[LLVMdev] Handling of thread_local globals by llc -march=cpp
> I note also that this is not a currently unsupported target case where an error should/could/would be produced on attempting to emit code with thread local references. I say this because clang is able to compile both c source with __thread on a global and bc containing a @variable = thread_local global ... and a function that references the thread local global variable to both assembly and
2020 Jan 09
2
Is there some sort of "@llvm.thread_ctors."?
We know that in C++, the constructor of a static member will get called when the program starts up. I checked the generated IR code and found this is implemented by defining a __cxx_global_var_init() function and marked it as section ".text.startup" and assign it to @llvm.global_ctors. We also know that in C++, the constructor of a static thread_local member will *not* get called when
2012 Apr 25
5
[LLVMdev] Adding support for explicitly specified TLS models (PR9788)
Hi all, I would like to hear your thoughts on adding support for extending the IR to allow for explicitly selecting which model to use for thread-local storage of a variable. The motivation is to allow Clang to support the "tls_model" variable attribute [1], as requested in PR9788. The idea would be to extend the IR to allow an optional TLS-model argument to the thread_local
2010 Jul 07
4
[LLVMdev] LLC Bug x86 with thread local storage
On Jul 7, 2010, at 4:52 AM, Patrick Marlier wrote: > Which one is correct ? > - movl $tm_nest_level at TPOFF, %ecx > or > - movq $tm_nest_level at TPOFF, %rcx > or > - movl tm_nest_level at TPOFF, %ecx > I believe this is initial exec and so from: http://people.redhat.com/drepper/tls.pdf it would be movl tm_nest_level at TPOFF, %ecx > Otherwise, Is there a
2009 May 04
1
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
Hi, If I'm writing a JIT, and want to access the TLS variables of the app containing the JIT, I can't use thread_local since that only works for variables declared in LLVM IL and/or managed by the ExecutionEngine. While this patch allows a JIT to generate the TLS accesses itself, if it knows the tls offset of the variable in question. Zoltan On Tue, May 5, 2009 at
2013 Feb 04
2
[LLVMdev] ARM c++ exceptions handling not working with clang/llvm-3.2?
Hello, am I wrong or the ARM c++ exceptions handling does not work? See the difference between assembly generated by clang and gcc with the following test code: #include <stdio.h> #include <exception> # test.cpp int main() { try { throw 20; } catch (int e) { printf("Exception Nr %d occurred\n", e); } return 0; }
2009 May 04
0
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
Hello, The preferred way to do TLS is to use the thread_local keyword. There is x86-64 support for thread_local on ELF; if you need it for other targets, I recommend looking at adapting it. Dan On May 4, 2009, at 2:59 PM, Zoltan Varga wrote: > Hi, > > Here is an updated version of the patch using address space 257. > > Zoltan > > On Mon, May 4, 2009 at
2017 Nov 16
2
question about xray tls data initialization
I'm learning the xray library and try if it can be built on windows, in xray_fdr_logging_impl.h line 152 , comment written as // Using pthread_once(...) to initialize the thread-local data structures but at line 175, 183, code written as thread_local pthread_key_t key; // Ensure that we only actually ever do the pthread initialization once. thread_local bool UNUSED Unused = [] {
2012 Sep 24
2
[LLVMdev] JIT problem with thread local global variable
Hello, I am trying to use LLVM JIT to emit the following codes and execute both functions in my program, but I get segmentation fault, the problem seems to originate from "thread_local" global variable. my LLVM library is 3.1 and platform is x86 32bit , OS : Ubuntu 10.04 @0 = internal thread_local global i32 522, align 4 define void @setValue(i32 %v) { %1 = alloca i32,
2013 Aug 02
1
[LLVMdev] replacing GetElementPtrConstantExpr with GetElementPtrInst ... sometimes
Hi During a pass, the XCore target lowers thread local global variables by turning them into global variable arrays indexed by the (max 8) thread ID. (see XCoreLowerThreadLocal.cpp) This works fine for instructions e.g. GetElementPtrInst But can't be done for constants e.g. GetElementPtrConstantExpr Thus I would like to replace GetElementPtrConstantExpr with GetElementPtrInst when it is
2017 Feb 08
2
[cfe-dev] lli: LLVM ERROR: Cannot select: X86ISD::WrapperRIP TargetGlobalTLSAddress:i64
What exactly do the compiler flags`-femulated-tls` and `tls-model` do ? Why does tls-emulation not solve the problem ? Looking at the generated IR, it seems not to remove thread_local variable declarations. What is the reasoning behind that ? 2017-02-07 16:27 GMT+00:00 Gaetano Checinski <gaetano.checinski at gmail.com>: > > got a minimal example now: > extern thread_local