similar to: [LLVMdev] how to invoke C functions in llvm IR ?

Displaying 20 results from an estimated 60000 matches similar to: "[LLVMdev] how to invoke C functions in llvm IR ?"

2016 May 29
1
How to find variable names from LLVM IR?
If I have an operand as a Value from an instruction like: Value* V = opnd->get(); and I am sure this is a variable, I want to know the variable name (in source code) for this Value object. I am doing it like this: const Function* Func; if (const Argument* Arg = dyn_cast<Argument>(V)) { Func =
2017 Jul 26
3
[RFC] Add IR level interprocedural outliner for code size.
Hi, On Wed, Jul 26, 2017 at 10:10 AM, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote: > No, I mean in terms of enabling other optimizations in the pipeline like > vectorizer. Outliner does not expose any of that. I have not made a lot of effort to understand the full discussion here (so what I say below may be off-base), but I think there are some cases where
2006 Mar 31
2
Missing probes in libc.so.1
Hi, I did "dtrace -l" on libc.so.1 with "_c??????" matching pattern and yield only two probes but there are 6 of them matches that pattern when invoke "nm" on libc. Why? See below for details: %dtrace -w -qn ''BEGIN {system("dtrace -l -mlibc.so.1 > libc_dtrace");} pid$target:libc:_c??????:entry{}'' -c ''sleep 1'' %
2017 Jan 26
2
mcjit C interface problems
Thanks for the tip - getting closer: $ ./capi_test 5 6 args[0]: 5 args[1]: 6 result: 4294959200 Here's the code I changed: printf("args[0]: %d\n", (int)LLVMGenericValueToInt(args[0], 0)); printf("args[1]: %d\n", (int)LLVMGenericValueToInt(args[1], 0)); uint64_t (*func)(); func = (uint64_t (*)())LLVMGetFunctionAddress(engine, "sum");
2017 Jul 26
2
[RFC] Add IR level interprocedural outliner for code size.
Hi, On Wed, Jul 26, 2017 at 12:54 PM, Sean Silva <chisophugis at gmail.com> wrote: > The way I interpret Quentin's statement is something like: > > - Inlining turns an interprocedural problem into an intraprocedural problem > - Outlining turns an intraprocedural problem into an interprocedural problem > > Insofar as our intraprocedural analyses and transformations are
2017 Dec 30
1
[PATCH v2] nv50/ir: Initialize all members of GCRA (trivial)
v2: use initialization list (Pierre) Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de> Reviewed-by: Pierre Moreau <pierre.morrow at free.fr> --- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
2017 Oct 11
2
How to create an alloca variable of type i64 in LLVM IR?
To create a stack based (local) 64 bit integer in LLVM IR, I used: Value *var = builder.CreateAlloca(Type::getInt64Ty(Ctx)); I wish to pass this variable to a function "void foo(unsigned long)". I created the signature of function foo() as follows: Constant *func = M->getOrInsertFunction("foo", Type::getVoidTy(Ctx),Type::getInt64Ty(Ctx), NULL); To pass the newly created
2015 Oct 05
2
Swift to IR, generates wrong IR
Hi, I have a simple swift code from which I generate IR code with ‘swiftc test.swift -emit-ir -o test.ll' When I try to run the .ll file or apply optimization with opt, I get errors like this one: lli: test.ll:548:110: error: expected instruction opcode %9 = cmpxchg i64* bitcast (%swift.type*** @field_type_vector_TipCalculator to i64*), i64 0, i64 %8 seq_cst seq_cst
2019 May 17
3
Copy Function from one LLVM IR file to another
Hello everyone, I wanted to copy a function from one file to another. The file that I wanted to copy the function into contains a function with the same name and same number of instructions. I decided to just replace the instructions with those of the other function. I am doing all of this from within a function pass. *1.* I created a function pass in which I extract a function using
2007 Aug 17
3
Is there any good tools to facilitate us to create R functions?
Dear R users, We have some programs for the specific task in our research, but they were very commonly used. We want to make some functions for them, anybody can recommend any good tools to facilitate us to create R functions even without going deep into the theories of R functions ? Any suggestions or help are greatly appreciated. -- With Kind Regards, oooO::::::::: (..):::::::::
2008 Apr 24
1
Calling R functions with multiple arguments from C
Hi, I'm writing a C function that has to call a R function with multiple arguments. I've read the relevant section in Writing R Extensions, and searched the R site, mailing lists as well as rseek. I managed to call the function, but I'm now having trouble creating the argument list. I tried to create a pairlist of the arguments and send it to the R function. The R function however
2004 Mar 27
3
a question about scoping functions
Hi, I've written some helper functions which are used by another function (called func()). When func() is sourced I dont want the helper function to be seen in the global namespace (as shown by ls()). Currently what I have done is: func <- function() { helper1 <- function() { ... } helper2 <- function() { ... } # some code } Is there anyway to take the functions
2009 Sep 30
2
[LLVMdev] Can I modify C syntax by using Clang and LLVM?
I want to add command line (shell) like statement to C is it possible to implement this syntax by clang and llvm? The syntax is like func arg1 arg2 ... argn; and define func like void func( int arg1, int arg2, ..., int argn) { ...} Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Jul 04
1
Calling C Code from R
Hi R Users, Thanks in advance. I am using R-2.5.1 on Windows XP. I am trying to call C code (testCX1.C) from R. testCX1.c calls another C code (funcC1.c) and returning a value to testCX1.c. I like to have this value in R. My steps are below: 1. R CMD SHLIB testCX1.c funcC1.c (at command propmt) 2. It creates testCX1.dll with warning (but testCX1.dll works):
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
Hi all, Recently I have implemented a transformation pass based on LLVM3.5 and its function is to duplicate the function's argument list in a bytecode file and replace all use of original function with modified function. In LLVM3.5, the pass can work properly. However, when I tried to transplant the pass to LLVM3.9, the error "Argument value does not match function argument type!"
2003 Feb 16
1
__stdcall funcitons called using .C() on win32 chokes
I've developed a dll (win32) of a bunch of functions prototypes as: /* for building on *nix */ #ifndef WIN32 #define __stdcall /*nothing*/ #endif void __stdcall dbh_2_height( const unsigned long *func_idx, const unsigned long *metric, const unsigned long *species, const double *dbh, double *pred_height ); and have created a R interface
2006 Jan 05
1
Generic Functions
Hi, I've been using the package "graph" in the BioConductor assortment and writing some functions based on its classes. My question is not specific to this package or BioConductor (I think), but it serves as a useful example. I recently wanted to look at the code for the function "edgeMatrix" for the class "graphNEL". Usually I would type > func.foo and
2006 Jan 20
1
Passing variable arguments to functions
Hi, Is there another way to pass arguments via a vector to arbitrary functions as in the following code example without using a series of if else statements? f <- test(func, x, parms, fargs1, fargs2, ...) { # parms is a vector of parameters to func. # ... is for use by f, not by func. n <- length(parms) if (n == 0) y <- func(x) else if (n == 1) y <- func(x,
2010 Sep 21
2
[LLVMdev] IR type safety
On 21 September 2010 17:48, Devang Patel <dpatel at apple.com> wrote: > In the combined llvm IR, @p3 and @p won't match as expected. Hi Devang, That's not quite what I was thinking... Maybe I explained badly... Imagine this: -- a.ll -- %struct.x = type { i32, i32 } %a = call void @func (%struct.x %b) -- b.ll -- %struct.y = type { i32, i32 } declare i32 @func (%struct.y)
2010 Aug 28
4
expression() and plot title
What I want to do is put the arguments I supply to a function into the title of a plot Say I'm calling func.1 func.1(a=4,b=4) plot(....,..., title("a=4, b=4")) If I'm calling func.1 with different arguments, I want the plot title to reflect that. A small detail is that func.1 might have an argument with a default like c=a+b. I tried using expression but couldn't get it to