similar to: [LLVMdev] Is it valid to add parameters to a function once it is created

Displaying 19 results from an estimated 19 matches similar to: "[LLVMdev] Is it valid to add parameters to a function once it is created"

2015 Mar 10
4
[LLVMdev] noob IR builder question
I am trying to get a handle on IR builder, at least some basics. I ran through a tutorial here: Create a working compiler with the LLVM framework, Part 1 <http://www.ibm.com/developerworks/library/os-createcompilerllvm1/>, and it worked well enough. I have some simple code that creates a hello world IR. I am trying to now bring in some concepts from the Kaleidoscope tutorial, namely
2013 May 22
1
[LLVMdev] Best strategy to add a parameter to a function
I am trying to build a function (C++ Builder) and at the same time extend its parameter set. Here's what I try to do: Value* arg0 = add_param_float("arg0"); Value* tmp = builder->CreateFAdd(arg0,some_previous_value); Value* arg1 = add_param_float("arg1"); The function add_param_float should add a 'float' parameter to the function and return its value. Right
2016 Mar 14
4
LLVM 3.8 change in function argument lists?
Hi, I am upgrading my project from 3.7 to 3.8. I find that following code used to compile in 3.7 but doesn't in 3.8 and I can't understand why. llvm::Function *mainFunc = ...; auto argiter = mainFunc->arg_begin(); llvm::Value *arg1 = argiter++; arg1->setName("obj"); But if I change the code to following it compiles: auto argiter = mainFunc->arg_begin(); llvm::Value
2005 Jun 07
5
Functions within functions in R and S-Plus
Sorry to bother you about a S-Plus related problem, but I hope someone can help. I have tried to "translate" some code from R to S-Plus (I have colleague that insists on using S-Plus. And yes, I have tried to make him change to R...) The following code works out fine in R, but in S-Plus (S-PLUS 6.2 for Windows Professional Ed.) I get the error message "Problem in est.theta(x):
2012 Jan 23
1
[LLVMdev] Code crashing in CreateGlobalStringPtr, passes when I add code for main routine + entry
Hi All, The following crashes in CreateGlobalStringPtr: #include "llvm/Support/DataTypes.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include
2014 Aug 02
2
[LLVMdev] LLVM Basic Program Compilation
Thank you Chris. I am using llvm-3.4.2. I am facing the same issue when using clang++ as well. $ clang++ try.cpp -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS `llvm-config --cxxflags --ldflags --libs` -S -emit-llvm gives me errors $clang++ try.cpp -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -S -emit-llvm $ lli try.s gives me Program used external function
2007 Jul 24
1
Passing equations as arguments
Friends, I'm trying to pass an equation as an argument to a function. The idea is as follows. Let us say i write an independent function Ideal Situation: ifunc <- function(x) { return((x*x)-2) } mainfunc <- function(a,b) { evala <- ifunc(a) evalb <- ifunc(b) if (evala>evalb){return(evala)} else return(evalb) } Now I want to try and write this entire program in a single
2012 Apr 25
2
[LLVMdev] Crash in JIT
Hello, [Using LLVM r155315, according to `svn log | head`] I am experimenting with programatically building and jitting functions in a module, and I seem to be coming across a crash in some generated code. Using the llvm-c interface I build up the module which dumps like this: ; ModuleID = 'MyModule' target datalayout = "i686-apple-darwin11" target triple =
2012 Apr 25
0
[LLVMdev] Crash in JIT
Hi David, I'm not certain, but to me the "LLVMSetTarget(module, "i686-apple-darwin11");" line looks suspicious. I'm not familiar with all the ins and outs of how target triples get handled, but it looks to me like that's requesting 32-bit code. I think that if you omit that line completely then the target will be inferred from the execution environment. My best
2019 Jul 08
2
Problem with the LLVM v8.0 IR 'select' instruction
Hi again, It is probably me doing something wrong, but I have attached a trimmed down sample that shows the issue and the output that Clang 8.0.0 makes (using the binary release from llvm.org). I invoke clang as follows: clang -S -O3 -o Evergrowing.s -Wall Evergrowing.ll I tried using -O1, -O2, and -O3, but all where the same. Please notice that I renamed 'main()' to
2007 Jul 20
5
[LLVMdev] Seg faulting on vector ops
Hola LLVMers, I'm looking to make use of the vectorization primitives in the Intel chip with the code we generate from LLVM and so I've started experimenting with it. What is the state of the machine code generated for vectors? In my tinkering, I seem to be getting some wonky machine instructions, but I'm most likely just doing something wrong and I'm hoping you can set me in
2007 Jul 21
0
[LLVMdev] Seg faulting on vector ops
On Fri, 20 Jul 2007, Chuck Rose III wrote: > I'm looking to make use of the vectorization primitives in the Intel > chip with the code we generate from LLVM and so I've started > experimenting with it. What is the state of the machine code generated > for vectors? In my tinkering, I seem to be getting some wonky machine > instructions, but I'm most likely just doing
2007 Jul 24
2
[LLVMdev] Seg faulting on vector ops
Hrm. This problem shouldn't be target specific. I am pretty sure prologue / epilogue inserter aligns stack correctly if there are stack objects with greater than default stack alignment requirement. Seems to be the initial alloca() instruction should specify 16 byte alignment? Evan On Jul 21, 2007, at 2:51 PM, Chris Lattner wrote: > On Fri, 20 Jul 2007, Chuck Rose III wrote:
2007 Jul 20
0
[LLVMdev] Seg faulting on vector ops
Hi Chuck! On Jul 20, 2007, at 11:36 AM, Chuck Rose III wrote: > Hola LLVMers, > > > > I’m looking to make use of the vectorization primitives in the > Intel chip with the code we generate from LLVM and so I’ve started > experimenting with it. What is the state of the machine code > generated for vectors? In my tinkering, I seem to be getting some > wonky
2012 Jul 06
2
[LLVMdev] Self-referential function pointer
Hey guys, I could use some advice on a special case of a function pointer as a formal argument. I would like the function pointer type to contain the actual signature of the function, i.e. not a pointer to var args function. This becomes an issue when I have a function which can take a pointer to itself as an argument... our terminology for this is "a recursive procedure". That is, of
2007 Jul 26
0
[LLVMdev] Seg faulting on vector ops
I am fairly certain this is right. Chuck, can you do a quick experiment for me? Go back to your original code but make sure the alloca instruction specify 16-byte alignment. The code should work. If not, please file a bug. Thanks, Evan On Jul 24, 2007, at 1:58 PM, Evan Cheng wrote: > Hrm. This problem shouldn't be target specific. I am pretty sure > prologue / epilogue inserter
2003 Dec 14
2
[LLVMdev] An assembly level interface for LLVM
Hi LLVMdev, Sorry about the bad title, but I hope you will get my idea. I think that in many LLVM programs that create/modify the LLVM IR (like say a language frontend/profiler etc), and in other cases too, some of the code is just "mechanical", for example creating function types takes like 4-5 lines of code, but nothing interesting goes on there. I think we can get rid of such code by
2019 Jul 07
2
Problem with the LLVM v8.0 IR 'select' instruction
Hi guys, I am doing a hobby compiler using LLVM. I have a rather peculiar problem with the 'select' instruction, as far as I can see. Given this code: ************************************************ ; Run-time Library Definitions %Exception = type { i8 } define private %Exception* @Start(i1* %$result) #0 { prologue: store i1 true, i1* %$result br label %epilogue epilogue:
2003 Dec 14
0
[LLVMdev] An assembly level interface for LLVM
Oops .. pardon my last incomplete posting, pushed Ctrl-Enter by accident! As I was saying .. Rahul's idea is interesting and would make some aspects of LLVM programming easier, but I wouldn't use it in my source language for the following reasons: 1. Of necessity the "snippet parser" would need to be based on the same language/grammar as AsmParser. Allowing parsing and