Displaying 20 results from an estimated 500 matches similar to: "[LLVMdev] inserting a function into a module"
2013 Oct 23
1
[LLVMdev] JIT functions' signature known only at runtime
Hi there! I am trying to figure out how I can call the function returned
by the JIT execution engine. The only circumstance that makes this case
a little problematic is that the function's signature is only available as
runtime state. More precisely the arguments to be passed are only
available as a vector of, e.g.,
union Types {
void *ptr;
float *ptr_float;
double *ptr_double;
2010 Feb 08
1
[LLVMdev] TypeBuilder for const void*
Hi!
In Line 230 of llvm\Support\TypeBuilder.h is support for void*:
/// void* is disallowed in LLVM types, but it occurs often enough in C
code that
/// we special case it.
template<> class TypeBuilder<void*, false>
: public TypeBuilder<types::i<8>*, false> {};
If would be cool if the same thing can be added for const void*:
template<> class
2010 Nov 29
3
[LLVMdev] FunctionType as a function argument
Hi all.
I would like to declare a function that takes a function pointer as an
argument.
In C, it would be :
void execute(char (*func)(void*), void *param)
So, in my compiler, I have :
std::vector<const Type *> cbFPtrArgs(1, Type::getInt8PtrTy(C));
FunctionType * cbFPtrTy = FunctionType::get(Type::getInt8Ty(C), cbFPtrArgs,
false);
Function * func =
2009 Aug 25
0
[LLVMdev] Simplifying a front-end project
On Tue, Aug 25, 2009 at 3:01 PM, Vikram S. Adve<vadve at cs.uiuc.edu> wrote:
> For my introductory Compiler Construction class, I have been giving
> the students a project to write a simple compiler for a toy, single-
> inheritance object-oriented language. We give them a set of classes
> implementing an AST for the language and a type checker as well. The
> students write
2010 Nov 29
0
[LLVMdev] FunctionType as a function argument
You need a pointer-to-function type, but FunctionType just gives you a
function type. Use PointerType::getUnqual(FunctionType::get(...)). Or
TypeBuilder<char (*func)(void*), false>::get(context) from
Support/TypeBuilder.h.
On Mon, Nov 29, 2010 at 10:37 AM, Salomon Brys <salomon.brys at gmail.com>wrote:
> Hi all.
> I would like to declare a function that takes a function pointer
2009 Aug 25
4
[LLVMdev] Simplifying a front-end project
For my introductory Compiler Construction class, I have been giving
the students a project to write a simple compiler for a toy, single-
inheritance object-oriented language. We give them a set of classes
implementing an AST for the language and a type checker as well. The
students write (1) a scanner and parser to build the AST; (2) a
translator from AST to LLVM; and (3) a couple of
2012 Mar 05
3
[LLVMdev] Problem using march=c
Hello everyone,
I've been trying to generate a C file using the llc tool, but I'm
having a problem. I'm using a single Hello World program in C, and
executing the following passes:
clang -emit-llvm -c -o hello.bc hello.c # getting the bit code of hello.c
llc -march=c hello.bc # generating the
hello.cbe.c file using the llvm C backend
So far, nothing weird
2013 Feb 17
2
[LLVMdev] Emitting recursive types
Hi,
I'm having a play with LLVM to implement a custom language (for my intellectual curiosity only). I'm wondering how, when using IRBuilder, one can can it to emit a recursive type definition? The code for TypeBuilder explicitly states that it doesn't handle recursive types...
I'm after being able to emit, programmatically, stuff like the Named Types example in the Language
2012 Aug 20
1
[LLVMdev] llmv3.0 CBackend convert IR to IR error
Thank you for answering my E-mail.
According to http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-March/047989.html,
I open the link:
https://hpcforge.org/scm/viewvc.php/trunk/patches/llvm.gpu.patch?root=kernelgen&view=markup
https://hpcforge.org/scm/viewvc.php/trunk/patches/llvm.patch?revision=591&root=kernelgen&view=markup
The result is:
SCM Repository
An Exception Has Occurred
2010 Aug 09
3
[LLVMdev] llvm "iword" type
That and the possibility of differently sized pointers made me
hesitate to dive into implementing this. I guess nailing it down to
be the platform equivalent of size_t would be sensible here.
On Mon, Aug 9, 2010 at 1:37 PM, Eugene Toder <eltoder at gmail.com> wrote:
> Small nitpick: size_t is not guaranteed to be large enough to hold a
> pointer (only an array index, which can be
2012 Mar 05
0
[LLVMdev] Problem using march=c
Hi Cristianno,
This problem has been around for a while, ourselves we solve it with the following patches:
https://hpcforge.org/scm/viewvc.php/trunk/patches/llvm.gpu.patch?root=kernelgen&view=markup
https://hpcforge.org/scm/viewvc.php/trunk/patches/llvm.patch?revision=591&root=kernelgen&view=markup
Please feel free to apply them, they *should* work for you even with the latest llvm
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
2012 Aug 18
0
[LLVMdev] llmv3.0 CBackend convert IR to IR error
Hi,
First of all, please note: as of v3.1, C backend has been thrown away
for being "buggy" and "unmaintained".
Several months ago there was a similar question, and it was solved.
Please see the patch attached here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-March/047989.html
Best,
- D.
2012/8/18 xiaoyaollvm <xiaoyaollvm at 126.com>:
> In llvm3.0,I use the llc
2012 Aug 18
2
[LLVMdev] llmv3.0 CBackend convert IR to IR error
In llvm3.0,I use the llc to convert the IR to C code,
But the code lack key words like "struct", Who can tell me how to modify the CBackend, 3Q ^-^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120818/ee901cb1/attachment.html>
2012 Mar 05
1
[LLVMdev] Problem using march=c
Hello again,
Thanks for the responses =)
Dmitry, I have two points to comment:
- First, I applied these two patches, and the .cbe.c file came out ok,
except for one little thing -- the global variable was created with
both modifiers: static and extern. Then, I just added a single guard
to prevent this to happen (in a case of a variable having local
linkage, the "extern" part was not
2012 Jul 02
4
[LLVMdev] [NVPTX] Backend failure in LegalizeDAG due to unimplemented expand in target lowering
Okay, few issues here:
First, i1 is used in the NVPTX back-end to map to the predicate (.pred)
type. We definitely do not want to declare this type as illegal. The real
issue is lack of complete support for this type. The PTX language places
restrictions on what can be done with .pred registers, and it looks like
the failure is here:
kernelgen_hostcall.exit228: ; preds =
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
Hi,
I'm trying to replace function call with call to
wrapper(function_name, num_args, ...), where varargs hold args of
original call.
Function* launch = Function::Create(
TypeBuilder<int(const char*, int, ...), false>::get(context),
GlobalValue::ExternalLinkage, "kernelgen_launch_", m2);
{
CallInst* call = dyn_cast<CallInst>(cast<Value>(I));
if
2010 Aug 09
0
[LLVMdev] llvm "iword" type
I looked through the "intp" thread.
I don't really want to start that argument up again, but my immediate
thought would be to create a new class of "picked-by-the-target" integer
types (equivelents of size_t, intptr_t, etc...), and two new instructions,
zcast and scast, which are only valid in the context of casting to / from
integer types of unknown sizes. To begin with,
2014 Dec 14
2
[LLVMdev] Question about node collapse
Hi John, all,
Thanks for your responses everybody.
This is actually helpful and I think I now better understand what is
going on here. Unless there is a pointer involved, DSA will not
collapse nodes. That makes sense...
What we would like to leverage DSA for is essentially type-unsafe
memory accesses, such as the example where code write a byte into the
0th byte of an integer. Another example
2011 Sep 22
0
[LLVMdev] How to const char* Value for function argument
Hi Dimitry,
This makes sense if you think about it from the perspective that the string you want passing must be passed at runtime, and so can't use a const char * from compile time.
You need to make the string visible in the compiled image, and use that as the argument. A string is an array of 8-bit integers, so you need to create a ConstantArray.
Value *v = ConstantArray::get(Context,