search for: intty

Displaying 20 results from an estimated 63 matches for "intty".

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...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...before we add this to the CVS repo, can you take a look at some of the changes I made to your HowToUseJIT example and use them to simplify this example too? For example, instead of code like this: // the type is 'int ()' std::vector<const Type*> ArgT(1); ArgT[0] = Type::IntTy; // now create full type of the "fib" function: FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result ArgT, /*not vararg*/false); // Now create the fib function entry and...
2004 Aug 17
4
[LLVMdev] JIT API example (fibonacci)
Hi LLVMers, the example attached I have used to prove that JIT and some visible optimizations are really invoked. Proved OK. I got 30% speed-up in comparison to gcc 3.3.3 on my Athlon XP 1500. Nice. P.S. guys, no fears, I don't plan to flood the cvs repository with my "brilliant" examples ;) --- Valery A.Khamenya -------------- next part -------------- An
2002 Sep 13
0
[LLVMdev] FYI: AllocaInst & MallocInst ctor change
...nstructor would take a Type which would specify the return type of the instruction, instead of the operand type. Now it takes the operand type directly. More concretely: LLVM Code: X = alloca int ; int* Y = malloc int * ; int** Old C++ code: X = new AllocaInst(PointerType::get(Type::IntTy)); Y = new MallocInst(PointerType::get(PointerType::get(Type::IntTy))); assert(X->getType() == PointerType::get(Type::IntTy)); New C++ code: X = new AllocaInst(Type::IntTy); Y = new MallocInst(PointerType::get(Type::IntTy)); assert(X->getType() == PointerType::get(Type::IntTy)); The old beh...
2004 Aug 09
1
[LLVMdev] API on JIT, code snippets
..."); > > > // We are about to create the add1 function: > Function *Add1F; > > { > // first create type for the single argument of add1 function: > // the type is 'int ()' > std::vector<const Type*> ArgT(1); > ArgT[0] = Type::IntTy; > > // now create full type of the add1 function: > FunctionType *Add1T = FunctionType::get(Type::IntTy, // type of result: int ()' > ArgT, > /*not vararg*/false); > > // Now create the add1 function entry and > // insert this entry...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
..."); > > > // We are about to create the add1 function: > Function *Add1F; > > { > // first create type for the single argument of add1 function: > // the type is 'int ()' > std::vector<const Type*> ArgT(1); > ArgT[0] = Type::IntTy; > > // now create full type of the add1 function: > FunctionType *Add1T = FunctionType::get(Type::IntTy, // type of result: int ()' > ArgT, > /*not vararg*/false); > > // Now create the add1 function entry and > // insert this entry...
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 ); GetElementPtrInst *m_Next = new GetElementPtrInst(mi, UZero, Zero, "tmp.3", BBlock ); ... =========...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
...are about to create the add1 function: > > Function *Add1F; > > > > { > > // first create type for the single argument of add1 function: > > // the type is 'int ()' > > std::vector<const Type*> ArgT(1); > > ArgT[0] = Type::IntTy; > > > > // now create full type of the add1 function: > > FunctionType *Add1T = FunctionType::get(Type::IntTy, // type of result: int ()' > > ArgT, > > /*not vararg*/false); > > > > // Now create the add1 function entry an...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
Reid wrote: > I have to agree with Misha on this. None of us knows "everything" about > LLVM and as you can see, Misha responded three hours before I did :). > Asking questions here is encouraged, so please feel free to post them on > LLVMdev. We'll always help where we can. well, OK :) Please find the attachment with the first approach to such an example i've
2004 Aug 09
3
[LLVMdev] API on JIT, code snippets
Valery, I have to agree with Misha on this. None of us knows "everything" about LLVM and as you can see, Misha responded three hours before I did :). Asking questions here is encouraged, so please feel free to post them on LLVMdev. We'll always help where we can. Thanks, Reid. On Mon, 2004-08-09 at 06:37, Misha Brukman wrote: > On Mon, Aug 09, 2004 at 12:32:33PM +0400, Valery
2004 Aug 17
5
[LLVMdev] JIT API example (fibonacci)
...t to create the "fib" function: > > Function *FibF; > > > > { > > // first create type for the single argument of fib function: > > // the type is 'int ()' > > std::vector<const Type*> ArgT(1); > > ArgT[0] = Type::IntTy; > > > > // now create full type of the "fib" function: > > FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result > > ArgT, > > /*not vararg*/false); > > > > // Now create the fib function entry and >...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...> > > // We are about to create the "fib" function: > Function *FibF; > > { > // first create type for the single argument of fib function: > // the type is 'int ()' > std::vector<const Type*> ArgT(1); > ArgT[0] = Type::IntTy; > > // now create full type of the "fib" function: > FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result > ArgT, > /*not vararg*/false); > > // Now create the fib function entry and > // insert this entry into...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
..."fib" function: >>> Function *FibF; >>> >>> { >>> // first create type for the single argument of fib function: >>> // the type is 'int ()' >>> std::vector<const Type*> ArgT(1); >>> ArgT[0] = Type::IntTy; >>> >>> // now create full type of the "fib" function: >>> FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result >>> ArgT, >>> /*not vararg*/false); >>> >>> // Now create the fib functio...
2004 Aug 18
1
[LLVMdev] JIT API example (fibonacci)
...;>> Function *FibF; > >>> > >>> { > >>> // first create type for the single argument of fib function: > >>> // the type is 'int ()' > >>> std::vector<const Type*> ArgT(1); > >>> ArgT[0] = Type::IntTy; > >>> > >>> // now create full type of the "fib" function: > >>> FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result > >>> ArgT, > >>> /*not vararg*/false); > >>> > >>&g...
2005 Oct 16
2
[LLVMdev] Help on LLVM Instrumentation
Hi , I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation : 1) injecting LLVM bytecode instructions 2) calling an external C function. I am trying both and
2004 Jun 17
4
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
...= new GlobalVariable(C->getType(), true, GlobalValue::InternalLinkage, C, mkStrName( strNumber++ ), &M); std::vector<Value*> params; //params to a CallInst std::vector<Value*> indices; //indices to gep indices.push_back((Value*) (ConstantInt::get(Type::IntTy, 0))); indices.push_back((Value*) (ConstantInt::get(Type::IntTy, 0))); Constant *gep = ConstantExpr::getGetElementPtr( (Constant*) str, indices); params.push_back((Value*) gep ); CallInst *CI = new CallInst(printf, params, std::string(""), I); This resulted in a "no...
2004 Aug 10
1
[LLVMdev] API on JIT, code snippets
..."); > > > // We are about to create the add1 function: > Function *Add1F; > > { > // first create type for the single argument of add1 function: > // the type is 'int ()' > std::vector<const Type*> ArgT(1); > ArgT[0] = Type::IntTy; > > // now create full type of the add1 function: > FunctionType *Add1T = FunctionType::get(Type::IntTy, // type of result: int ()' > ArgT, > /*not vararg*/false); > > //...
2005 Jan 31
1
[LLVMdev] Question about Global Variable
...of the initial value, it is a pointer of constant, like constant *. I cannot assign it to the AddrOfGstr[i]. How could I get memory address the initial vaule, not the pointer of constant? I tried to use the following way, std::vector <Value *> idxVec; Value *Zero1 = ConstantInt::get(Type::IntTy , 0); Value *Zero2 = ConstantInt::get(Type::IntTy , 0); idxVec.push_back(Zero1); idxVec.push_back(Zero2); Constant *pStr = ConstantExpr::getGetElementPtr(Cstr, idxVec); // trying to get pointer of initial value GetElementPtrInst *GEP = new GetElementPtrInst( PointerAry , idxVec, "GetAryElem...
2002 Oct 11
2
[LLVMdev] Accessing a function's arguments
I am trying to generate a simple wrapper function: Function* pWrapper = m_module.getOrInsertFunction(name, FunctionType::get(Type::VoidTy, vector<const Type*>(1, PointerType::get(Type::IntTy)), false)); How do I actually get the Value* for the one argument to this function? The pWrapper->getArgumentList().size() is 0. Shouldn't the argument list contain the Value* for the parameter? DEBUG(pWrapper->dump();); DEBUG(pWrapper->getFunctionType()->dump()); DE...
2004 Jun 17
0
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
...s will autonumber them for you to keep them unique, and is likely to be more efficient than this implementation. > std::vector<Value*> params; //params to a CallInst > std::vector<Value*> indices; //indices to gep > indices.push_back((Value*) (ConstantInt::get(Type::IntTy, 0))); > indices.push_back((Value*) (ConstantInt::get(Type::IntTy, 0))); > Constant *gep = ConstantExpr::getGetElementPtr( (Constant*) str, indices); This looks fine, but you can drop the casts. > params.push_back((Value*) gep ); > > CallInst *CI = new CallInst(printf,...