LLVM and GMP

someguy wrote:

Oh. One more thing:

Paulo, while your working out how to do what Chris said (making usage
of bigints into library calls), wouldn't it just warm your heart to
document the process on the wiki?

</wiki pimping>

Oh. I see. That way the bigints don't need a representation in llvm IR... neat.

Sorry for the misdirecton!

I could be wrong, but I think that you may need to add a 'big-integer'
intrinsic type to llvm.
        

No, please don't. GMP is just another library like libc, your front-
end should just generate calls into it like any other library. This
is similar to how we handle threading and many other "language
features".

-Chris

_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Hello
First of all, thanks for your answers.
I've been investigating on how to generate the calls to GMP, and how to make the IRBuilder generate the IR containing them but, so far, I found nothing about that. I read the documentation on LLVM, but I don't know how to do it yet. Some help would be a blessing, since I'm a bit lost.

About documenting the process in the wiki, it seems a very good idea, so anyone in the future, who has the same problem can easily solve it. But first I need to find the solution myself! :slight_smile:

Thanks in advance
Paulo Matias

I added a simple little HowTo that might help you in the wiki. It's about inserting a function call to an external library function, but it's implemented as an optimization pass instead of part of the front end. It might still give you some pointers though. Here is the link:
http://wiki.llvm.org/HowTo:_Insert_a_function_call

Anthony