search for: getintptrtyp

Displaying 20 results from an estimated 34 matches for "getintptrtyp".

Did you mean: getintptrtype
2011 Mar 26
2
[LLVMdev] How to read memory data througn adress of unsigned long
...new LoadInst(addr, "", false, bb); encounter segmentation fault. ######################## I also try to use IntToPtrInstr to do some transform as the following: ################################ Type const *intptr_type = cpu->dyncom_engine->exec_engine->getTargetData()->getIntPtrType(_CTX()); Value* ptr = new IntToPtrInst(v, intptr_type, "", bb); Value* data = new LoadInst(ptr, "", false, bb); ######################################## still encounter segmentation fault Any person can give me some hints for my case? Thanks in advance. I have...
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...te::NoUnwind }; + AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs); + + LLVMContext &Context = B.GetInsertBlock()->getContext(); + Constant *StrNLen = M->getOrInsertFunction( + "strnlen", AttributeSet::get(M->getContext(), AS), + DL.getIntPtrType(Context), B.getInt8PtrTy(), DL.getIntPtrType(Context), nullptr); + CallInst *CI = B.CreateCall(StrNLen, {castToCStr(Ptr, B), MaxLen}, "strnlen"); + if (const Function *F = dyn_cast<Function>(StrNLen->stripPointerCasts())) + CI->setCallingConv(F->getCallingConv()); + +...
2011 Mar 26
0
[LLVMdev] How to read memory data througn adress of unsigned long
...to load from an integer without first casting it to a pointer, which you do next. > I also try to use IntToPtrInstr to do some transform as the following: > ################################ >      Type const *intptr_type = > cpu->dyncom_engine->exec_engine->getTargetData()->getIntPtrType(_CTX()); >       Value* ptr = new IntToPtrInst(v, intptr_type, "", bb); >       Value* data = new LoadInst(ptr, "", false, bb); >  ######################################## >  still encounter segmentation fault > > Any person can give me some hints for my case?...
2011 Mar 14
2
[LLVMdev] How to load a data from the address of unsiged long type
...tCastInst(a, PointerType::get(XgetType(Int32Ty), 0), "", bb); Value* data = new LoadInst(addr, "", false, bb); Error: Bitcast requires types of same width 3. Code: Type const *intptr_type = cpu->dyncom_engine->exec_engine->getTargetData()->getIntPtrType(_CTX()); Value* ptr = new IntToPtrInst(a, intptr_type, "", bb); Value* data = new LoadInst(ptr, "", false, bb); Error: Segmentation fault Any person can give me some hints for my case? Thanks MK -- www.skyeye.org
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...const Type *SBP = PointerType::get(Type::SByteTy); static Function *MemCpy = 0; - if (!MemCpy) - MemCpy = TheModule->getOrInsertFunction("llvm.memcpy", Type::VoidTy, SBP, - SBP, Type::UIntTy, Type::UIntTy, + const Type *IntPtr = TD.getIntPtrType(); + if (!MemCpy) { + const char *Name = IntPtr == Type::UIntTy ? + "llvm.memcpy.i32" : "llvm.memcpy.i64"; + MemCpy = TheModule->getOrInsertFunction(Name, Type::VoidTy, SBP, + SBP, IntPtr, Type::UIntTy,...
2007 Oct 01
2
[LLVMdev] Lowering operations to 8-bit!
So does that mean that LLVM can't lower automatically to 8-bit values? I tried defining 8-bit pointers in the subtarget using "p:8:8:8" but it asserts at line 566 of TargetData.cpp in the default case of TargetData::getIntPtrType() Is it difficult to add 8-bit support? A. -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Chris Lattner Sent: Friday, September 28, 2007 5:01 PM To: LLVM Developers Mailing List Subject: Re: [LLVMdev] Lowering operations to 8...
2010 Sep 07
0
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
On Sep 7, 2010, at 11:30 AM, F van der Meeren wrote: > > > Any ideas on what I am doing wrong here ? > Why not just use something like: const Type *ArgPtr = Type::getInt8PtrTy(Context); const Type *IntPtr = getTargetData().getIntPtrType(Context); and then: const Type *ArgTypes[3] = {ArgPtr, ArgPtr, IntPtr }; Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy, ArgTypes, 3) to get the type of memcpy? Trying to declare it that way is likely confusing to the system. -eric
2011 Jan 24
2
[LLVMdev] How to create an IntegerType of the native word size
Hi all, I couldn't find any reasonable way to create the IntegerType that would match, say, intptr_t, that is the native word size of the machine I'm building on. More accurately defined, when compiling on a 64 bit Mac OS machine I want it to be Int64Ty, but if for example I'm using the "-arch i386" command line option on that machine during compilation, I want it to be
2011 Mar 14
0
[LLVMdev] How to load a data from the address of unsiged long type
...Type(Int32Ty), 0), "", bb); > Value* data = new LoadInst(addr, "", false, bb); > Error: > Bitcast requires types of same width > 3. Code: > Type const *intptr_type = > cpu->dyncom_engine->exec_engine->getTargetData()->getIntPtrType(_CTX()); > Value* ptr = new IntToPtrInst(a, intptr_type, "", bb); > Value* data = new LoadInst(ptr, "", false, bb); > Error: > Segmentation fault > > > Any person can give me some hints for my case? > > Thanks > MK &g...
2010 Sep 07
2
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
I have created the function prototype with the following code: const uintmax_t methodNameSize = 1024; const char methodNameTemplate[] = "llvm.memcpy.p0i%llu.p0i%llu.i%llu"; char methodName[methodNameSize]; // Create the methodName. memset(methodName, 0, methodNameSize); sprintf(methodName, methodNameTemplate, dstSize, srcSize, lengthSize); // Search for the
2007 Oct 01
0
[LLVMdev] Lowering operations to 8-bit!
...VT) const { return !MVT::isExtendedVT(VT) && RegClassForVT[VT] != 0; } Is there a 16-bit register class? > I tried defining 8-bit pointers in the subtarget using "p:8:8:8" > but it > asserts at line 566 of TargetData.cpp in the default case of > TargetData::getIntPtrType() Dunno why it's like this. Can you add case 1: return Type::Int8Ty? Does it work / help? Evan > > Is it difficult to add 8-bit support? > > A. > > -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf...
2008 May 15
0
[LLVMdev] Troubling promotion of return value to Integer ...
...promotion at all. However, if you do need to do the promotion, you need to know the type of "int". It's not entirely clear to me what is the best way to accomplish. To me, I don't think TargetLowering is the right place to add the hook. How about TargetData.h ? There is a getIntPtrType(), perhaps we need a getIntType()? Evan > > Thanks > Ali > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part --...
2007 Oct 03
2
[LLVMdev] Lowering operations to 8-bit!
...VT) const { return !MVT::isExtendedVT(VT) && RegClassForVT[VT] != 0; } Is there a 16-bit register class? > I tried defining 8-bit pointers in the subtarget using "p:8:8:8" > but it > asserts at line 566 of TargetData.cpp in the default case of > TargetData::getIntPtrType() Dunno why it's like this. Can you add case 1: return Type::Int8Ty? Does it work / help? Evan > > Is it difficult to add 8-bit support? > > A. > > -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf...
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
2007 Oct 04
0
[LLVMdev] Lowering operations to 8-bit!
...ExtendedVT(VT) && RegClassForVT[VT] != 0; > } > > Is there a 16-bit register class? > >> I tried defining 8-bit pointers in the subtarget using "p:8:8:8" >> but it >> asserts at line 566 of TargetData.cpp in the default case of >> TargetData::getIntPtrType() > > Dunno why it's like this. Can you add case 1: return Type::Int8Ty? > Does it work / help? > > Evan > >> >> Is it difficult to add 8-bit support? >> >> A. >> >> -----Original Message----- >> From: llvmdev-bounces at cs.uiuc.edu [...
2007 Oct 08
3
[LLVMdev] Lowering operations to 8-bit!
...ExtendedVT(VT) && RegClassForVT[VT] != 0; > } > > Is there a 16-bit register class? > >> I tried defining 8-bit pointers in the subtarget using "p:8:8:8" >> but it >> asserts at line 566 of TargetData.cpp in the default case of >> TargetData::getIntPtrType() > > Dunno why it's like this. Can you add case 1: return Type::Int8Ty? > Does it work / help? > > Evan > >> >> Is it difficult to add 8-bit support? >> >> A. >> >> -----Original Message----- >> From: llvmdev-bounces at cs.uiuc.edu [...
2009 Mar 11
0
[LLVMdev] Creating Pointer Constants
On 2009-03-08, at 12:46, Nyx wrote: > I am writing a JIT compiler for a subset of the Matlab language and > as a > part of my implementation, I would like to be able to pass a constant > pointer to a native function I'm calling. > > Right now, this is what I do: > > llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty, > (int64)thePointer); >
2010 Sep 07
2
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
...n Sep 7, 2010, at 11:30 AM, F van der Meeren wrote: > >> >> >> Any ideas on what I am doing wrong here ? >> > > > Why not just use something like: > > const Type *ArgPtr = Type::getInt8PtrTy(Context); > const Type *IntPtr = getTargetData().getIntPtrType(Context); > > and then: > > const Type *ArgTypes[3] = {ArgPtr, ArgPtr, IntPtr }; > Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy, ArgTypes, 3) > > to get the type of memcpy? Trying to declare it that way is likely confusing to the system. > > -eric
2012 Aug 21
1
[LLVMdev] How to know the size of a 'long'?
AFAIK, if I want to call an external C function from IR code, I need to use Function::Create() to create a Function whose signature matches the external C function, then call ExecutionEngine::addGlobalMapping() to "bind" the LLVM Function to the external C function (right?). Assuming that's correct, if the external C function is declared: void foo(long); how can I know whether to
2007 Sep 29
0
[LLVMdev] Lowering operations to 8-bit!
On Sep 28, 2007, at 4:53 PM, <Alireza.Moshtaghi at microchip.com> <Alireza.Moshtaghi at microchip.com> wrote: > ExpandOp is not called at all. > In SelectionDAGLegalize::HandleOp() only the ValueType is > considered in > the switch statement to decide if it is legal or promote or expand. > As I trace back (correct me if I'm wrong) these values are set in >