similar to: [LLVMdev] Get the value of a GlobalVariable

Displaying 20 results from an estimated 500 matches similar to: "[LLVMdev] Get the value of a GlobalVariable"

2007 Aug 21
7
mocking singletons
How can I safely mock a singleton without the mocked method living on outside the scope of the test method? I''ve run into this problem with mocking methods on globals (gasp!) in the past by doing something like def mock_my_global original = $my_global $my_global.expects(:foo).returns(''bar'') yield $my_global = original end Is there something similar I
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
2017 May 30
2
llvm::GlobalVariable usage (newbie question)
The docs are pretty vague about this. After digging into the examples I got the following to work with JIT to gain a pointer to variable elsewhere in the runtime, but I'd like to understand what is going on here, and if there is a, um, nicer API that I'm missing? llvm::Value* C::getGlobalVariable(const char* name, llvm::Type* t) {
2013 Jul 19
4
[LLVMdev] Disable vectorization for unaligned data
What is the proper solution to disable auto-vectorization for unaligned data? I have an out of tree target and I added this: bool OpusTargetLowering::allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const { if (VT.isVector()) return false; .... } After that, I could see that vectorization is still done on unaligned data except that llvm will copy the data back and forth from the source
2013 Jul 20
0
[LLVMdev] Disable vectorization for unaligned data
On Jul 19, 2013, at 3:14 PM, Francois Pichet <pichet2000 at gmail.com> wrote: > > What is the proper solution to disable auto-vectorization for unaligned data? > > I have an out of tree target and I added this: > > bool OpusTargetLowering::allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const { > if (VT.isVector()) > return false; > .... > } >
2012 Nov 25
2
[LLVMdev] MCJIT and Lazy Function Creators
Out of curiosity, I'm replacing the JIT with MCJIT on my compiler. As all "external" functions are provided by the language's FFI mechanism, it does MyExecutionEngine->DisableSymbolSearching(); MyExecutionEngine->InstallLazyFunctionCreator(&MyLazyFunctionCreator); which works fine with the JIT. However, MCJIT insists on resolving unknown symbols by searching them
2013 Jul 19
0
[LLVMdev] Disable vectorization for unaligned data
On Fri, Jul 19, 2013 at 1:14 PM, Francois Pichet <pichet2000 at gmail.com> wrote: > > What is the proper solution to disable auto-vectorization for unaligned > data? Why are you trying to do this? If auto-vectorization is making a given loop slower on your target, that means the cost metrics are off, and we should fix them. If code size is an issue, you should tell the optimizer
2013 Jul 21
2
[LLVMdev] Disable vectorization for unaligned data
Ok any quick workaround to limit vectorization to 16-byte aligned 128-bit data then? All the memory copying done by ExpandUnalignedStore/ExpandUnalignedLoad is just too expensive. On Sat, Jul 20, 2013 at 12:52 PM, Arnold Schwaighofer < aschwaighofer at apple.com> wrote: > > On Jul 19, 2013, at 3:14 PM, Francois Pichet <pichet2000 at gmail.com> wrote: > > > > >
2005 Jun 29
1
Can't build cdr_addon_mysql.
I have been unable to build cdr_addon_mysql from asterisk-addons-1.09. Could it be a mysql4 issue [root@server9 asterisk-addons-1.0.9]# make cdr_addon_mysql cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:24:22: asterisk.h: No such file or directory I have MySQL devel # ls /usr/include/mysql/ total 404 drwxr-xr-x 2
2012 Nov 27
0
[LLVMdev] MCJIT and Lazy Function Creators
Óscar Fuentes <ofv at wanadoo.es> writes: > Out of curiosity, I'm replacing the JIT with MCJIT on my compiler. As > all "external" functions are provided by the language's FFI mechanism, > it does > > MyExecutionEngine->DisableSymbolSearching(); > MyExecutionEngine->InstallLazyFunctionCreator(&MyLazyFunctionCreator); > > which works fine
2006 Jan 30
3
RMySQL install
I am having trouble installing RMySQL on a clean install of Fedora Core 4 64 bit on a dual dual core machine (that is, two dual core processors). Seems like the LD_LIBRARY_PATH is incorrect, but I don't seem to have it quite right yet. There are a few mentions of this problem in google, but thus far none of the "fixes" and fixed my problem. I've tried defining the
2007 Sep 22
4
[LLVMdev] RFC: Patch
Hi all, I have a patch that would potentially help Objective-C 2. In the "make_decl_llvm()" in llvm-backend.cpp, there is code to search through the already generated global variables. Objective-C goes through this code twice with the same identifier. The first time, is to create meta-data for a "property". The second time is to add a reference to that property into the
2012 Nov 11
1
[LLVMdev] wrong value with getPointerToGlobal
I'm having some trouble getting access to a global variable with getPointerToGlobal. The resulting value is not what I am expecting. My assembly looks something like this: @gresult = global i32 undef define i32 @eval_expr() { entry: ... store i32 %3, i32* @gresult ret i32 %3 } Where "gresult" is created with: auto global = new llvm::GlobalVariable( *module, int32Type,
2012 Nov 12
2
[LLVMdev] getPointerToGlobal() / MCJIT
Hi all, are there any plans to correct/implement the "getPointerToGlobal()" method for accessing global variables that are emitted by MCJIT? (see for details the unit test of MCJIT) Best Regards Armin
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
I don't think it's the same problem as you described. By printing I meant calling printf function and passing my global variable as one of the arguments. My code: Instruction* InstructionVisitor::incrementGlobalKey(Instruction* I) { IRBuilder<> Builder(I->getContext()); Builder.SetInsertPoint(I->getNextNode()); GlobalVariable* key =
2004 May 11
1
[LLVMdev] Follow-up on: Dynamic updates of current executed code
Hello! I am coming back to the below discussion again, regarding the LLVM support of Ruby dynamics. The initial problem description is as follow, to refresh your memory :) After that my questions come: -----------BEGIN Initial problem description--------------- Problem is though, that the Ruby compiler is integrated in the compilation of the program being executed, to be able to parse &
2014 Mar 21
3
[LLVMdev] lli crashes when running cpp programs
Hi all, I need to run c++ prgrams using lli. However, I find lli cannot handle the alias instruction correctly. Following is an example: ------------ example.cc ------------- #include <iostream> using namespace std; class cls { public: cls(); ~cls(); }; cls::cls() { cout << "constructor" << endl; }; cls::~cls() { cout <<
2012 Nov 13
0
[LLVMdev] getPointerToGlobal() / MCJIT
As far as I know, no one is working to fix the test case in question. Patches welcome :) Cheers, Dan On 2012-11-13, at 1:29 AM, "Armin Steinhoff" <armin at steinhoff.de> wrote: > > Hi all, > > are there any plans to correct/implement the "getPointerToGlobal()" method for accessing global variables that are emitted by MCJIT? > (see for details the
2009 Oct 06
1
[LLVMdev] 2.6/trunk Execution Engine question
On Tue, Oct 6, 2009 at 5:49 PM, Reid Kleckner <rnk at mit.edu> wrote: >> Also, the null pointer is coming from a call to JCE->allocateSpace(). >> This is a virtual function; I'm trying to discover what subclass it >> is. > > So, there's JITEmitter::allocateSpace which overrides > JITCodeEmitter::allocateSpace(), but *most* of the time it just calls >
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
Hi Everyone, I'm quite new to LLVM and I want to update value of global variable in LLVM IR. I created new global variable in ModulePass: bool runOnModule(llvm::Module &M) { IRBuilder<> Builder(M.getContext()); Instruction *I = &*inst_begin(M.getFunction("main")); Builder.SetInsertPoint(I); M.getOrInsertGlobal("globalKey",