Displaying 20 results from an estimated 79 matches for "thread_locals".
Did you mean:
thread_local
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 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) {
2007 Apr 11
2
[LLVMdev] ideas for TLS implementation
For everyone understand which code must be emitted to implement TLS, I
will paste the code generated by gcc for a simple function:
__thread int a = 1;
int f(){
return a;
}
gcc teste.c -o teste.s -S -O2 (arm-linux-gnueabi):
.global a
.section .tdata,"awT",%progbits <== special section for
tls symbols
.align 2
.type a, %object
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
3
[LLVMdev] Handling of thread_local globals by llc -march=cpp
target triple = "i386-pc-linux-gnu"
On 13/05/2010, at 9:25 PM, Anton Korobeynikov wrote:
>> int (*FP)() = (int (*)())FPtr;
>> int res = FP();
>>
>> when the function executes correctly in the case of instead having created a standard global variable.
> What is the platform you're running the code on?
>
> --
> With best regards, Anton
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
2012 Nov 08
2
[LLVMdev] Bug Report -- Possible optimizer bug with thread_local variables
...n terms of LLVM's design, I've noticed that thread_local variables are
represented in the same way as ordinary variables (via
llvm::GlobalVariable) except that the "isThreadLocal" flag is true. This
strikes me as a potential for confusion, because you have this one corner
case -- thread_locals -- in which an "llvm::Constant" is not really a
"constant" in the same way as other constants. This might be related to
http://llvm.org/bugs/show_bug.cgi?id=13720, and perhaps a few other bugs.
-Tom
p.s. If anyone is hit by this bug, my current workaround is to declare Ptr
vo...
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
2010 May 13
0
[LLVMdev] Handling of thread_local globals by llc -march=cpp
Hello
> 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 for the report. Should be
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 May 13
2
[LLVMdev] Handling of thread_local globals by llc -march=cpp
Thanks for the quick reply and fix. Now it just means I have to hunt further in exploring why, in my simple test program, replacing the following line of code:
GlobalVariable* global = new GlobalVariable(*MyModule,
IntegerType::get(getGlobalContext(), 32), false, GlobalValue::ExternalLinkage, 0, "global");
with the following line of code:
GlobalVariable* global = new
2012 Nov 08
0
[LLVMdev] Bug Report -- Possible optimizer bug with thread_local variables
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Tom Bergan
> Subject: [LLVMdev] Bug Report -- Possible optimizer bug with thread_local variables
> my current workaround is to declare Ptr volatile:
> int * volatile Ptr;
> Note that if the volatile is moved under the pointer, as in the following:
> volatile int * Ptr;
>
2012 Dec 12
0
[LLVMdev] how to execute a *.ll with a thread_local global variable?
hi guys,
i wrote a small program that can load the *.ll file, parse it and execute
it.
but there is a thread_local global variable.
during execution, it says:
Cannot allocate thread local storage on this arch!
UNREACHABLE executed at /root/llvm/lib/Target/X86/X86JITInfo.cpp:585!.
it seems that i did not initialize the executionEngine right or i shouldnot
use InitializeNativeTarget()?
i
2007 Jul 11
2
[LLVMdev] thread_local
Hi,
This weekend, I've noticed that GlobalVariable's could be declared as
thread-local in LLVM 2.0. However, when using it on a small example
(OSX), I got the following error:
=========
Cannot yet select: 0x56059f0: i32 = GlobalTLSAddress <i32* @a> 0
Abort trap
=========
This is the example code:
=========
; ModuleID = 'test.o'
target datalayout =
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
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
2012 Nov 09
0
[LLVMdev] Bug Report -- Possible optimizer bug with thread_local variables
Hi Tom,
On Wed, Nov 7, 2012 at 11:43 PM, Tom Bergan <tbergan at cs.washington.edu> wrote:
> Hello,
>
> I apologize if this has already been fixed or reported. I believe there is
> a bug in the way the optimizer deals with thread_local variables. The
> attached program, test.c, has a thread-local variable "int Foo" and a global
> variable "int *Ptr".
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
2017 Feb 07
3
[cfe-dev] lli: LLVM ERROR: Cannot select: X86ISD::WrapperRIP TargetGlobalTLSAddress:i64
> I’ve seen the same problem, but didn’t find solution back then.
> I can give a hint that it is related to a thread local storage (notice
TLS in the name).
>
> The same result can be reproduced by this simple program:
>
> thread_local int x = 0;
> int main() {
> return 0;
> }
>
>When compiled into IR it produces similar error:
>
>LLVM ERROR:
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 = [] {