Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] The 2 ways of building for Windows"
2013 Apr 30
0
[LLVMdev] Clang on windows can't compile a code with a zeroinitializer array
When the .bc file contains an array as the following:
@.str = private global [7 x i8] zeroinitializer
"llc -march=x86" generates the following x86 assembly lines:
.data
.lcomm L_.str,7
And trying to compile it with clang generates an error: "fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x3".
Is that fixable?
Thanks!
Alon
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 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 anything to do with LLVM's
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
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 Nov 14
0
[LLVMdev] Using LLVM to serialize object state -- and performance
I've been profiling more; see <https://dl.dropbox.com/u/46791180/perf.png>.
One thing I'm a bit confused about is why I see a FunctionPassManager there. I use a FunctionPassManager at the end of LLVM IR code generation, write the IR to disk, then read it back later.
Why is apparently another FunctionPassManager being used during the JIT'ing of the IR code? And how do I
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
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++
2014 Jan 06
2
[LLVMdev] Why do X86_32TargetMachine and X86_64TargetMachine classes exist?
These two subclasses of X86TargetMachine are basically identical.
The *only* thing that's different is the constructor. And that *only*
differs in the is64Bit argument that it passes to the X86TargetMachine
constructor. Replacing the hard-coded 'true' or 'false' with
'Triple(TT).getArch()==Triple::x86_64' makes them *actually* identical.
Can we just ditch the
2012 Apr 11
0
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
On Apr 8, 2012, at 10:40 PM, Bill Wendling wrote:
> On Apr 8, 2012, at 8:47 AM, Paul J. Lucas wrote:
>
>> But I assume [the personality function] works only for a *nix/g++ system. My code also needs to work when compiled on Windows using Visual Studio and I'm guessing that it needs a different personality function. Where do I get that?
>
> That's not something
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 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 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 Mar 22
0
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
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 anything to do with LLVM's IR-level exception system. It sounds to me like you just need a way to handle C++ exceptions inside of the C++ code
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 use GEP, you have to provide the