similar to: [LLVMdev] Bad Instruction 4 with fastcc

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Bad Instruction 4 with fastcc"

2011 Jul 01
3
[LLVMdev] Pointer Constant?
I'm writing a JIT for my toy language, and I'm confused by one thing. How do I, with IR Builder, Insert a pointer constant? For the first version of my jit, I really only need LLVM to pass around opaque types and then pass those variables to C functions that return other opaque types. So for instance, I have a Int object that wraps the GNU GMP routines. A want to be able to tell IRBuilder
2011 May 12
2
[LLVMdev] Pre-built LLVM shared libs for Windows?
I'd like to do some simple C# -> LLVM C API bindings for windows. Is there a place I can get pre-built LLVM .dlls for windows? Thanks Timothy -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -------------- next part -------------- An HTML attachment was scrubbed...
2011 May 12
3
[LLVMdev] Vtables for non c++ languages
I'm working on implementing a simple functional language in LLVM. It's statically typed, but I'd like to a have some simple multimethods involved. Does LLVM have some intrinsics for handling something like C++ vtables? Or do I need to implement my own way of handling single-dispatch functions? Thanks, Timothy -- “One of the main causes of the fall of the Roman Empire was
2012 Dec 26
1
[LLVMdev] Proper values for LLVMCreateTargetMachine
I can't seem to get LLVMCreateTargetMachine to work on my box (MBP i7 OS X 10.8). What should the values of triple, cpu and features be? I'm just looking for a way to get this up and going for now, I don't need specific optimizations. No matter what I send the function, I always get nil back. I'm giving it LLVMGetFirstTarget as the target value. Thanks for the help, Timothy
2011 Jul 02
0
[LLVMdev] Pointer Constant?
1. Create an extern global variable of the type being pointed to. Use ExecutionEngine::addGlobalMapping to map that extern global variable to the pointer. Then your IR code can refer to the extern global variable and get the pointer. 2. Convert the pointer to an int. Create an int constant in IR. Then add an inttoptr instruction, and your IR has the pointer constant. Last I checked, though,
2011 Jun 28
2
[LLVMdev] Box removal
In the creation of dynamic languages we often have to box values together. For instance, take the following expression: IntObj c = sqrt((a*a)+(b*b)); Here, most likely, a bytecode interpreter would execute this as "mul_ints", "add_ints", "sqrt", etc. Inside these primitive functions we would have to unwrap our IntObj types, add the values, allocate a new object and
2011 Apr 07
2
[LLVMdev] opt + fastcc bug?
Hi, Is this correct behaviour? test.ll: declare {} @__ex__print_int(i64) define i32 @main() { entry: %0 = call i64 @f.1() %1 = call {} @__ex__print_int(i64 %0) ret i32 0 } define internal fastcc i64 @f.1() { entry: ret i64 7 } > opt -std-compile-opts test.ll -S ; ModuleID = 'test.ll' define i32 @main() noreturn nounwind { entry: tail call void @llvm.trap()
2014 Jan 17
2
[LLVMdev] Invalid RegNum error
I'm writing a compiler using LLVM, and suddenly today I started to get this error, when emitting to a .s file. Assertion failed: (I != M+Size && I->FromReg == RegNum && "Invalid RegNum"), function getLLVMRegNum, file MCRegisterInfo.cpp, line 78. I'm emitting using x86_64-apple-darwin. Any thoughts about what could be causing this? LLVM validation does not
2009 Nov 19
2
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
Er... Sending this to the list instead of the parent... On Thu, Nov 19, 2009 at 4:49 AM, Hans Wennborg <hans at hanshq.net> wrote: > Yesterday I realised that if a Function has the calling convention set > to "fast", then it is a bad idea to call it through the function pointer > one gets from ExecutionEngine::getPointerToFunction(). > > The problem is that when
2009 Feb 12
6
[LLVMdev] fastcc, tail calls, and gcc
Two related questions. This is with LLVM 2.4 doing a JIT compile to x86-64. (I generate LLVM IR using an IRBuilder instance, compile/optimize, and then call getPointerToFunction() to get a "native" function pointer.) (1) My reading of various mailing list messages seems to indicate that a function marked as using the "fastcc" calling convention
2013 Jan 22
1
[LLVMdev] Compiling to NVPTX
I'm in the process of writing a library and giving a talk about writing compilers using LLVM (llvm-c) and Clojure. As part of my talk I'd like to give an example of a program running on CUDA. Are there any papers, tutorials, examples, on writing a custom frontend for NVPTX? For instance, I'm trying to figure out how to get access to "global" variables like blockidx. I know
2009 Nov 19
2
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
> I agree with you OvermindDL1, > > SInce the language I'm going to be working on doesn't support varargs, it would be nice to be able to ditch the C calling convention for fastcc in all occurrances for an added speed boost.  I also will need to add my own library calling convention on one platform I plan on supporting which will be register-loaded as well. Are you going to be
2009 Feb 12
0
[LLVMdev] fastcc, tail calls, and gcc
On Thu, Feb 12, 2009 at 5:34 PM, Jeff Kuskin <jk500500 at yahoo.com> wrote: > Two related questions. > (2) Why does the x86-64 JIT backend generate a "ret $0x8" instruction > to return from a fastcc function that is (a) marked as fastcc > (CallingConv::Fast); but (b) takes no arguments and returns 'void'? fastcc generated code ends with this: > c20800
2011 Apr 07
0
[LLVMdev] opt + fastcc bug?
On Wed, Apr 6, 2011 at 10:48 PM, Nicolas Ojeda Bar <nojb at math.harvard.edu> wrote: > Hi, > > Is this correct behaviour? > > test.ll: > > declare {} @__ex__print_int(i64) > > define i32 @main() { > entry: >  %0 = call i64 @f.1() >  %1 = call {} @__ex__print_int(i64 %0) >  ret i32 0 > } > > define internal fastcc i64 @f.1() { > entry: >
2009 Nov 19
0
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
----- Original Message ---- > From: Kenneth Uildriks <kennethuil at gmail.com> > To: Samuel Crow <samuraileumas at yahoo.com> > Cc: OvermindDL1 <overminddl1 at gmail.com>; LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Thu, November 19, 2009 12:22:55 PM > Subject: Re: [LLVMdev] fastcc and ExecutionEngine::getPointerToFunction() > > >
2009 Feb 12
0
[LLVMdev] fastcc, tail calls, and gcc
Jeff Kuskin wrote: > Correct? If not, how do I call a LLVM JIT-generated fastcc function > from a function statically compiled by GCC? Well, you can always generate a little wrapper function with C calling convention which just calls the fastcc function. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr.Graef at t-online.de, ag at
2009 Nov 19
1
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
On Thu, Nov 19, 2009 at 12:45 PM, Samuel Crow <samuraileumas at yahoo.com> wrote: > > > > > ----- Original Message ---- >> From: Kenneth Uildriks <kennethuil at gmail.com> >> To: Samuel Crow <samuraileumas at yahoo.com> >> Cc: OvermindDL1 <overminddl1 at gmail.com>; LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> >> Sent:
2009 Nov 19
2
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
Yesterday I realised that if a Function has the calling convention set to "fast", then it is a bad idea to call it through the function pointer one gets from ExecutionEngine::getPointerToFunction(). The problem is that when calling it from my C++ program, the call will be made C-style, while the function expects to be called the fastcc way. Could LLVM either warn the user of this,
2013 Feb 14
2
[LLVMdev] Question about fastcc assumptions and seemingly superfluous %esp updates
Hello, While investigating one of the existing tests (test/CodeGen/X86/tailcallpic2.ll), I ran into IR that produces some interesting code. The IR is very straightforward: define protected fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) { entry: ret i32 %a3 } define fastcc i32 @tailcaller(i32 %in1, i32 %in2) { entry: %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32
2009 Feb 12
1
[LLVMdev] fastcc, tail calls, and gcc
On Feb 12, 2009, at 3:23 PM, Albert Graef wrote: > Jeff Kuskin wrote: >> Correct? If not, how do I call a LLVM JIT-generated fastcc function >> from a function statically compiled by GCC? > > Well, you can always generate a little wrapper function with C calling > convention which just calls the fastcc function. You can do a quick bit of assembly code to make sure that