similar to: [LLVMdev] JIT and array pointers

Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] JIT and array pointers"

2005 Apr 11
2
[LLVMdev] JIT and array pointers
On Sun, 2005-04-10 at 19:47 -0500, Chris Lattner wrote: > On Mon, 11 Apr 2005, Paul wrote: > > I'm trying to pass an array pointer to my run-time generated module, and > > after a long time of searching for the answer, the only thing I got was > > a headache. Basically I have a few arrays (few megabytes which will > > sometimes be accessed as 8 / 16 / 32 / 64 bit
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, dummy1 at boxpl.com wrote: >> There are many possible ways to do this, can you be a bit more specific >> about what you're trying to do? > Here is a basic example: Ah, ok, I see what you're trying to do. Below is some *pseudo* code for the basic idea: > ============================================ > unsigned int buff[4096]; > > int main
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, Paul wrote: > I'm trying to pass an array pointer to my run-time generated module, and > after a long time of searching for the answer, the only thing I got was > a headache. Basically I have a few arrays (few megabytes which will > sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that > will be modified by both the generated module, and my
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha, Thanks for your answer I was doing this: ======================== BasicBlock *BBlock = new BasicBlock("entry", MyFunc); ... Value *Zero = ConstantSInt::get(Type::IntTy, 0); Value *UZero = ConstantUInt::get(Type::UIntTy, 0); MallocInst* mi = new MallocInst( STyStru ); mi->setName("tmp.0"); BBlock->getInstList().push_back( mi );
2006 May 01
2
[LLVMdev] printf decleration
I am writing a pass where I need to make a function deceleration for printf. Below is the code I'm trying to use. ----- bool MyPass::runOnModule(Module &m) { vector<const Type*> args; args.push_back(PointerType::get(Type::SByteTy)); Function* f = m.getOrInsertFunction("printf", FunctionType::get(Type::IntTy, args, true)); ----- When I insert a call
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote: >>> The instructions seem to have one path wrong. It says to get: >> >> I'll put together a tarball today. That will be easier than dealing with >> a patch, and it will include a bunch of bugfixes since the previous email. > Further into process, I get this error: > In file included from
2006 Jun 25
1
[LLVMdev] adding args to func call
This question is similar to Ryan Lefever's post on May 1, 2006 about printf declaration. In my case, I want to insert fprintf(stderr, ...) calls. I'm new to LLVM, and I don't know what's the recipe for putting together the arguments. Can someone give me basic instructions or point me in the direction on what to do? I can't find any more documentation on this. Thanks!
2006 May 01
0
[LLVMdev] printf decleration
Ok, I think I figured it out. I talked to someone, and we figured out that when I make a call to printf with a constant string, I need to make a global variable and use getElementPtr to reference it. The modified call for accessing the printf is: /* m is Module*, f is Function*, i is Instruction* */ Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv =
2005 Mar 16
1
[LLVMdev] Dynamic Creation of a simple program
Hi, Given these C instructions: ============================== struct stru { struct stru *Next; }; struct list *NewStru = malloc ( sizeof ( struct stru ) ); struct list *tmp.3; ... tmp.3 = NewStru->Next; ============================== LLVM generates something like this: %tmp.0 = malloc %struct.stru ; <%struct.stru*> %tmp.3 = getelementptr %struct.stru* %tmp.0, int 0, uint 1 ;
2010 Apr 13
1
Another newbie question on encoding
Hi, I'm very sorry if those questions are repeated over and over, but I cannot find a solution on the net. I try to use speex to encode/decode voice to send over the network. My doubts are: 1. The Bits_Per_Sample I use, are independent from the speex encoding/decoding? (So...can I use 8, 16, 24..and so on?) 2. If I have this situation: SAMPLE RATE.....: 8000 BITS PER SAMPLE.: 16
2005 Mar 21
3
[LLVMdev] arguments to standard library functions
HI , I understand that the standard C library functions are executed using the native library of the host machine. ( for example when we execute a bytecode to extract the profile info ) Is it possible to extract for each standard library function that is executed , the arguments that the function is called with. For example if printf ("%d", some_int ) when called during runtime
2002 Sep 25
3
[LLVMdev] question about GetElementPtr Instruction
I have a question about GetElementPtr. Suppose I have an GetElementPtr Instruction GI: %reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint 5, uint 13 I want to check if this is the reference of a component of a structure, how can I do that? Should I check which operand of this instruction is 'ubyte' type? How can I do that in code? should I use ubyte *a =
2003 Jan 28
1
[LLVMdev] Building a new struct type, etc
Hi folks, I was just wondering if someone would be willing to tell me the best way to make a new structure type in LLVM and get it inserted as a valid type into a particular Module instance? I've done the following: vector<const Type*> types; types.push_back(Type::UIntTy); types.push_back(Type::UIntTy); structType = StructType::get(types); But
2004 May 21
1
[LLVMdev] Re: LLVMdev digest, Vol 1 #292 - 4 msgs
Hi, Thank Brian Gaeke so much. Following TraceBasicBlocks.cpp, I modified the code as below and could insert instruction or function I need into anywhere in Module. But it works well without BB->getInstList().push_back(InstrCall), and if I add the BB->getInstList().push_back() following new CallInst(), I got error information when runing opt. What is the reason for it? And is it necessary
2006 Jun 30
1
[LLVMdev] instruction sequence
I'm trying to insert a call to fprintf(stderr, ...). I've looked at the emitted assembly from llvm-gcc, and it consists of a LoadInst (of stderr) and CallInst. It looks like this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %tmp.1 = load %struct._IO_FILE** %stderr ; ty=%struct._IO_FILE* %tmp.0 = call int (%struct._IO_FILE*, sbyte*, ...)* %fprintf(%struct._IO_FILE* %tmp.1, sbyte*
2002 Sep 22
2
[LLVMdev] Accessing constant indexes in GetElementPtr
Ok. Let's say I have a GetElementPtrInst that is used to access structure elements. In this case the indexes will be constants and I want to get the constant values as an a native C int. Now I can iterate over all the indexes with idx_begin(). I can cast all of the indexes to a ConstantIntegral. However, I cannot cast the indexes to a ConstantSInt or ConstantUInt (cast<> throws an
2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
> Also sprach Wojciech Stryjewski: > } Ok. Let's say I have a GetElementPtrInst that is used to access > structure > } elements. In this case the indexes will be constants and I want > to get the > } constant values as an a native C int. > } > } Now I can iterate over all the indexes with idx_begin(). I can cast > } all of the indexes to a ConstantIntegral. However,
2004 Apr 05
1
[LLVMdev] Two important changes to the getelementptr instruction
On Sun, 4 Apr 2004, Reid Spencer wrote: > Congrats on getting this taken care of finally. I know its something > you've wanted to do since 1.0. It certainly has been on the grand TODO list for a long time :) > I have one question. How does LLVM disambiguate between a uint used for > a structure and a uint used for an array? It depends on the operand number of the
2007 Mar 07
1
[LLVMdev] UIntTy, IntTy, and SByteTy
I have llvm code that uses llvm::Type::UIntTy, llvm::Type::IntTy, and llvm::Type::SByteTy, but these are now removed. What should I use for their replacement. If I need to specify a size for IntTy and UIntTy, I want them to be the same size that an integer would be in C on the platform on which I'm compiling. So, if I need the sizes is their a way to fetch the size that an integer
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Chris Lattner wrote: >> Any ideas what could be wrong? > > Sorry for the delay, please try this tarball: > http://nondot.org/sabre/2006-03-02-llvm-gcc-4.tar.gz Actually, do to a recent change in CVS, this tarball will probably not work anymore. Please apply the attached (small) patch on top of it in the gcc directory. Worth noting, this front-end only works