search for: lucasmail

Displaying 20 results from an estimated 46 matches for "lucasmail".

2012 Oct 02
1
[LLVMdev] Offset to C++ structure members
On Oct 2, 2012, at 2:34 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > On Tue, Oct 2, 2012 at 11:33 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > >> My understanding is that, in order to use GEP, you have to provide the LLVM code with the struct layout, i.e., build a StructType object. In my case, that struct is declared in C++ code already and, in order to use GEP, I'd have to replicate the struct layout (exa...
2012 Mar 23
2
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
On Mar 22, 2012, at 11:40 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > On Mar 22, 2012, at 12:28 AM, Bill Wendling wrote: > >> On Mar 20, 2012, at 7:38 PM, Paul J. Lucas wrote: >> >>> I've read the docs on LLVM exceptions, but I don't see any examples. A little help? >> >> I don't think this has...
2012 Apr 10
2
[LLVMdev] Building LLVM+clang on Windows
I'm following the instructions here: http://clasg.llvm.org/get_started.html and, while running cmake, I get: > CMake Error at cmake/modules/LLVM-Config.cmake:141 (message): > Library `vectorize' not found in list of llvm libraries. > Call Stack (most recent call first): > cmake/modules/LLVM-Config.cmake:54 (explicit_map_components_to_libraries) >
2012 Nov 14
0
[LLVMdev] Using LLVM to serialize object state -- and performance
...o I control what the passes are to that FunctionPassManager? The function that's being JIT'd has to executed only once so, ideally, I want to find a sweet spot between speed-of-JIT'ing and speed-of-generated-machine code. - Paul On Nov 13, 2012, at 11:27 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > Switching to CodeGenOpt::None reduced the execution time from 5.74s to 0.84s. By just tweaking things randomly, changing to CodeModel::Small reduced it further to 0.22s. > > We have some old, ugly, pure C++ code that we're trying to replace (both because it's ug...
2012 Mar 23
0
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
On Mar 22, 2012, at 5:29 PM, Bill Wendling wrote: > On Mar 22, 2012, at 11:40 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > >> Unfortunately, I'm not following. How is having the code that catches all exceptions in a separate function different from what I proposed (putting the try/catch in the thunks)? (Ideally, I want to minimize layers of function calls.) Again for reference: > &...
2012 Oct 02
0
[LLVMdev] Offset to C++ structure members
On Tue, Oct 2, 2012 at 11:33 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > On Oct 1, 2012, at 9:58 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > >> Using GEP on an i8* is a bit nicer to the optimizer, though, because >> using ptrtoint/inttoptr has effects on alias analysis. > > My understanding is that, in order to us...
2012 Nov 13
3
[LLVMdev] Using LLVM to serialize object state -- and performance
Switching to CodeGenOpt::None reduced the execution time from 5.74s to 0.84s. By just tweaking things randomly, changing to CodeModel::Small reduced it further to 0.22s. We have some old, ugly, pure C++ code that we're trying to replace (both because it's ugly and because it's slow). It's execution time is about 0.089s, so that's the time to beat. Hence, I'd like to
2012 Oct 02
2
[LLVMdev] Offset to C++ structure members
On Oct 1, 2012, at 9:58 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > Using GEP on an i8* is a bit nicer to the optimizer, though, because > using ptrtoint/inttoptr has effects on alias analysis. My understanding is that, in order to use GEP, you have to provide the LLVM code with the struct layout, i.e., build a StructType object. In my case, that struct is declared in C++
2012 Apr 02
1
[LLVMdev] Demo invalid instruction
Using the LLVM demo <http://llvm.org/demo/> with this code: > int G; > > struct E { > }; > > struct S { > ~S(); > void throw_it(); > }; > > S::~S() { > ++G; > } > > void S::throw_it() { > throw E(); > } > > int main() { > S s; > s.throw_it(); > } and selecting C++ as the source language an "LLVM C++ API
2012 Apr 10
0
[LLVMdev] Building LLVM+clang on Windows
"Paul J. Lucas" <paul at lucasmail.org> writes: > I am using LLVM 3.0 because I want a stable version. There doesn't > seem to be an equivalent clang 3.0 -- is there? Is you use a Clang source tree that is more than a few days (or hours!) off from LLVM, chances are that it won't work. Clang sources for release 3...
2012 Apr 24
1
[LLVMdev] Linking executable error on Windows
I followed the build instructions for LLVM+clang -- that all went OK. But compiling a simple "hello world" program with clang++ gives a linker error -- see attached log file. - Paul -------------- next part -------------- A non-text attachment was scrubbed... Name: build.log Type: application/octet-stream Size: 1881 bytes Desc: not available URL:
2012 May 28
1
[LLVMdev] Windows build problems for LLVM 3.1
Attempting to use VC++ 2008 Express, when I try to link a test program, I get a bunch of symbols like __imp_open not found. Attempting to use VC++ 2010 Express, I get "Solution Folders are not supported" so, although it will build, there's no way to build the INSTALL target. - Paul
2012 May 28
3
[LLVMdev] Windows assertion failure
Given this small program: > #include <llvm/DerivedTypes.h> > #include <llvm/LLVMContext.h> > > using namespace llvm; > > int main( int argc, char const *argv[] ) { > LLVMContext &ctx = getGlobalContext(); > > Type *void_type( Type::getVoidTy( ctx ) ); > PointerType *void_ptr_type( void_type->getPointerTo() ); > > return 0; > }
2012 May 29
1
[LLVMdev] The 2 ways of building for Windows
>From what I've read, you can build/use LLVM+clang via Visual Studio or via MinGW. So far, I've only managed to have my code working via MinGW. However, most of my users compile using Visual Studio. Can LLVM that was compiled using MinGW (or using the pre-built MinGW binary) be linked against using Visual Studio (or, more specifically, using Visual Studio's "cl"
2012 Sep 19
1
[LLVMdev] Saving code for later execution
I'm using the LLVM C++ API to create code on-the-fly for execution. This works fine. But what if I want to save this code to disk, quit, relaunch my app at some later time, reload the previously generated code off disk, and execute it? How can I do that? Can somebody point me to some documentation or examples? Thanks. - Paul
2012 Oct 03
1
[LLVMdev] Getting dump of native assembly?
I'm using the IRBuilder C++ API to generate LLVM IR code and execute it on-the-fly. I know about Module::dump() to print the IR code, but is there any way to print out the native assembly code (x86 in my case)? - Paul
2012 Oct 18
1
[LLVMdev] Incrementing a pointer to array element?
Using the LLVM C++ API, if I want to create an array via an Alloca instruction like: Value *a = ir_builder.CreateAlloca( my_type, my_size ); and then I want to initialize each element of the array with values computed elsewhere like: for ( vector<Value*>::const_iterator i = v.begin(); i != v.end(); ++i ) { builder.CreateStore( *i, a ); // How do I increment 'a' to point to
2012 Oct 22
2
[LLVMdev] Reading IR from a std::ostream
Previously I had asked how to write then read back IR to/from a file. The write code looked like: LLVMContext ctx; SMDiagnostic diag; Module *m = ParseIRFile( "my_file", diag, ctx ); However, the code I'm trying to retrofit LLVM IR into passes me just a std::ostream&. How can I read IR from a std::ostream? I figured out how to use raw_os_ostream to adapt a
2012 Nov 14
2
[LLVMdev] Using LLVM to serialize object state -- and performance
...o I control what the passes are to that FunctionPassManager? The function that's being JIT'd has to executed only once so, ideally, I want to find a sweet spot between speed-of-JIT'ing and speed-of-generated-machine code. - Paul On Nov 13, 2012, at 11:27 AM, Paul J. Lucas <paul at lucasmail.org> wrote: > Switching to CodeGenOpt::None reduced the execution time from 5.74s to 0.84s. By just tweaking things randomly, changing to CodeModel::Small reduced it further to 0.22s. > > We have some old, ugly, pure C++ code that we're trying to replace (both because it's ug...
2012 May 01
1
[LLVMdev] Linking C++ on Windows
I've followed all the LLVM+clang build-from-source instructions for Windows using MSVC++ 2008. It all builds fine. I initially had troubling getting any linking to work at all until I made sure to have the right environment variables set using a wrapper batch script. Now C programs compile, link, and execute fine, but C++ programs don't link, not even a simple "hello, world"