similar to: [LLVMdev] how to compile a program to make the global variable thread local using clang?

Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] how to compile a program to make the global variable thread local using clang?"

2012 Dec 05
2
[LLVMdev] how to get and modify a global variable inside a module
hi Eduardo, thanks for your attention, i checked the iterator, but i didn't see any fucntion can return or modify the main memory address of a global variable inside the module. can you provide some reference code or program can achieve this? thank you very much -- View this message in context:
2012 Dec 05
4
[LLVMdev] how to get and modify a global variable inside a module
recently, i use LLVM API to write a program to read *.ll and excute it automatically. Further more, i want to change some global variables inside a module. i tried some functions provided by Module.h and ExecutionEngine.h but none were seemed to match my need. did someone have the experience or some advices? thank you ;) -- View this message in context:
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
Hi Dong Chen, You can write a ModulePass class and implement a runOnModule method. Inside this method you can access Module::global_iterator and get a reference to all global variables of a module. With this reference, you can change this variable. But be careful, you may need to change also the references to those variables. Have a look to the method GlobalVariable::use_begin and use_end. They
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
Hi Dong Chen, I realized you are actually executing the IR, right? I am not sure if the things I mentioned apply in that case. Actually, I wrote a optimization pass that modify the IR. It modifies global variables and the final IR is intended to be compiled. A snippet of what I do looks like this: class TestClass : public llvm::ModulePass { public: TestClass() : llvm::ModulePass(TestClass::ID)
2012 Sep 25
2
[LLVMdev] JIT problem with thread local global variable
Thanks for your hint, I will try that Have A Nice Day Chia Lun -- View this message in context: http://llvm.1065342.n5.nabble.com/JIT-problem-with-thread-local-global-variable-tp49263p49273.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello guys, recently, i successfully get and modify global variable by execution engine. the functions i used are listed here: int m=1; EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m); EE->recompileAndRelinkFunction(EntryFn); x is the global variable in the module. but how to modify the local variable in the module? -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello Óscar Fuentes, thanks for your reply, if i use the API provided by parser.h and the program *.ll i parsed contains local variable, i can get a module have local variable without defines it first. i think that module is a structure like AST(i am not sure whether i was right), this must be a traversal method. am i right or do i misunderstand something? -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes, i am new to llvm, so i still have several questions. thanks for you help. (1)what is SSA form(static single assignment)? (2)how to traverse the basic blocks? if the module is gained by parser, what will the basic blocks contain? i will be on the line, thank you very much -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes , thanks for your reply, but there are still a lot of concepts i don't understand. there seems to be some document to guide you but hard to understand. can you show me some basic and easy to learn document or websites? thank you -- View this message in context:
2012 Dec 05
3
[LLVMdev] how to get and modify a global variable inside a module
hi Duncan Sands, i have tried the functions: GlobalValue * getNamedValue (StringRef Name) const GlobalVariable * getGlobalVariable (StringRef Name, bool AllowInternal=false) const GlobalVariable * getNamedGlobal (StringRef Name) const but i think these functions just return the ID or something else (not the Global Variable's main memory address, i am not sure) here is the thing. i
2013 Apr 09
3
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hi, Duncan, thank you for your reply; instruction "i->getOperand(0)->dump()" may print the %4 in the screen, but how can i store it in a variable like char * oprand="%4" ? -- View this message in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572p56588.html Sent from the LLVM - Dev mailing
2013 Apr 14
8
[LLVMdev] llvm 'select' instruction
hello guys: i am thinking about what kind of C instructions can turn into llvm IR 'select' instruction. i tried "d=a?b:c" and compiled it using clang, i still didn't get 'select' is there anybody who knows this? thank you -- View this message in context: http://llvm.1065342.n5.nabble.com/llvm-select-instruction-tp56719.html Sent from the LLVM - Dev mailing list
2012 Sep 24
0
[LLVMdev] JIT problem with thread local global variable
Hi, > 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 try passing -use-mcjit to lli. The old JIT implementation didn't
2013 Apr 14
0
[LLVMdev] llvm 'select' instruction
Something like this should do the job (taken from a test file from the libbeauty decompiler project): /* A very simple jump table. */ int test58(int var1) { int n = 0; switch (var1) { case 1: n = 1; break; case 2: n = 2; break; case 3: n = 3; break; case
2013 Apr 14
1
[LLVMdev] llvm 'select' instruction
hi Sam: thank you for your reply. but i have another question about this 'select' instruction. i think that in LLVM IR, i can use a branch and two seperate assignments to replace 'select' instruction(am i right?). so is there any compiling option to aviod generate 'select' instruction? -- View this message in context:
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,
2012 Dec 05
2
[LLVMdev] how to get and modify a global variable inside a module
hi Eduardo, i got what you did, but it seemed that you modified the Global Variable list, deleted Global Variable and created new one and added it to the list. I don't know whether i got it right and for more details, can you get the main memory address of the Global Variable? or did the iterator provide method to get this? thank you very much -- View this message in context:
2012 Dec 12
1
[LLVMdev] how to use the argument -cl-kernel-arg-info for clang?
hi everyone, have you ever tried the argument -cl-kernel-arg-info for clang? can you share the usage? thank you -- View this message in context: http://llvm.1065342.n5.nabble.com/how-to-use-the-argument-cl-kernel-arg-info-for-clang-tp52524.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
On 12/5/12 2:49 PM, Dong Chen wrote: > here is the thing. i want to know the exact main memory address of the > Global Varibale's address when ExecutionEngine execut the *.ll code. further > more, i want to change the address, is it possible? I assume you want to adjust the value at that address, right? Then you might want to check the ExecutionEngine::getPointerToGlobal method. You
2012 Dec 10
0
[LLVMdev] how to get and modify a local variable's value through executionEngine?
Dong Chen <jameschennerd at gmail.com> writes: > hello guys, > recently, i successfully get and modify global variable by execution engine. > the functions i used are listed here: > int m=1; > EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m); > EE->recompileAndRelinkFunction(EntryFn); > x is the global variable in the module.