search for: pointertype

Displaying 20 results from an estimated 434 matches for "pointertype".

2007 Dec 17
3
[LLVMdev] PointerType API Change
Christopher, > The API for getting PointerType objects has just changed to make > Embedded C address space information explicit. The old semantics of > PointerType::get() now apply to PointerType::getUnqual(), which > returns a pointer in the generic address space. PointerType::get() now > requires both a type and an address space....
2007 Dec 17
3
[LLVMdev] PointerType API Change
The API for getting PointerType objects has just changed to make Embedded C address space information explicit. The old semantics of PointerType::get() now apply to PointerType::getUnqual(), which returns a pointer in the generic address space. PointerType::get() now requires both a type and an address space. The clang,...
2009 Oct 20
3
[LLVMdev] Dereference PointerType?
Hello, I'm wondering if it's possible to dereference a PointerType. I have an AllocaInst and although I can find the number of elements allocated, (using Instruction::getOperand(0)), I can't find a way to get the size of each element. What I'd like to do is: AllocaInst *alloca; PointerType *ptr_type = dynamic_cast<PointerType*>(alloca); assert(ptr_...
2007 Dec 17
0
[LLVMdev] PointerType API Change
On Dec 16, 2007, at 10:22 PM, Anton Korobeynikov wrote: > Christopher, > >> The API for getting PointerType objects has just changed to make >> Embedded C address space information explicit. The old semantics of >> PointerType::get() now apply to PointerType::getUnqual(), which >> returns a pointer in the generic address space. PointerType::get() >> now >> requires both a...
2016 Oct 30
2
RFC: PointerType should derive from Type rather than SequentialType
Hi all, An oddity that has existed for a long time in the IR is that PointerType derives from SequentialType. Per subject I propose to make PointerType derive from Type for a couple of reasons: - Values of type PointerType are unlike the other SequentialTypes (arrays and vectors) in that they do not hold values of the element type. By moving PointerType we can unify certain as...
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
2009/10/20 Daniel Waterworth <da.waterworth at googlemail.com> > Hello, > > I'm wondering if it's possible to dereference a PointerType. I have an > AllocaInst and although I can find the number of elements allocated, (using > Instruction::getOperand(0)), I can't find a way to get the size of each > element. What I'd like to do is: > > AllocaInst *alloca; > > PointerType *ptr_type = dynamic_cast<Poin...
2007 Dec 17
0
[LLVMdev] PointerType API Change
On 2007-12-17, at 00:31, Christopher Lamb wrote: > The API for getting PointerType objects has just changed to make > Embedded C address space information explicit. The old semantics of > PointerType::get() now apply to PointerType::getUnqual(), which > returns a pointer in the generic address space. PointerType::get() > now requires both a type and an address...
2009 Oct 20
2
[LLVMdev] Dereference PointerType?
Daniel Waterworth <da.waterworth at googlemail.com> writes: [snip] Use the getElementType method of PointerType. >> size_t size; >> if (isa<PointerType>(allocated_type)) { >> size = sizeof(void*) * 8; >> } else { >> size = allocated_type->getPrimitiveSizeInBits(); >> } >> // size now equals the size (in bits) of the type allocated This looks suspicious...
2016 Oct 31
2
RFC: PointerType should derive from Type rather than SequentialType
Thanks David. I ended up trying this over the weekend (see https://github.com/llvm-project/llvm-project/compare/ master...pcc:pointertype). It ended up being a net reduction in code size so seems like a useful cleanup even independent of the typeless pointer work, I'll see if I can send a patch to the list. FWIW I think this directly helps towards the migration because we would have a clearer idea of where we are legitimately ca...
2016 Oct 31
0
RFC: PointerType should derive from Type rather than SequentialType
...uce as an intermediate step compared to progress towards the end goal directly. Perhaps not much. - Dave On Sat, Oct 29, 2016 at 8:41 PM Peter Collingbourne via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi all, > > An oddity that has existed for a long time in the IR is that PointerType > derives from SequentialType. Per subject I propose to make PointerType > derive from Type for a couple of reasons: > > - Values of type PointerType are unlike the other SequentialTypes (arrays > and vectors) in that they do not hold values of the element type. By moving > Pointe...
2007 Dec 17
2
[LLVMdev] PointerType API Change
...address space", then one should even be able to continue to use get() isntead of sth like getQual(...). Torvald On Monday 17 December 2007, Christopher Lamb wrote: > On Dec 16, 2007, at 10:22 PM, Anton Korobeynikov wrote: > > Christopher, > > > >> The API for getting PointerType objects has just changed to make > >> Embedded C address space information explicit. The old semantics of > >> PointerType::get() now apply to PointerType::getUnqual(), which > >> returns a pointer in the generic address space. PointerType::get() > >> now > &g...
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...Alignment(); EmitAggregateCopy(Target, MemRef(LV.Ptr, Alignment, isVolatile), TREE_TYPE(exp)); @@ -5885,9 +5896,10 @@ LValue TreeToLLVM::EmitLV_DECL(tree exp) Value *Decl = DECL_LLVM(exp); if (Decl == 0) { if (errorcount || sorrycount) { - const PointerType *Ty = - PointerType::getUnqual(ConvertType(TREE_TYPE(exp))); - return ConstantPointerNull::get(Ty); + const Type *Ty = ConvertType(TREE_TYPE(exp)); + const PointerType *PTy = PointerType::getUnqual(Ty); + LValue LV(ConstantPointerNull::get(PTy), TD.getABITypeAlignment(T...
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
Óscar Fuentes wrote: > Daniel Waterworth <da.waterworth at googlemail.com> writes: > > [snip] > > Use the getElementType method of PointerType. > >>> size_t size; >>> if (isa<PointerType>(allocated_type)) { >>> size = sizeof(void*) * 8; >>> } else { >>> size = allocated_type->getPrimitiveSizeInBits(); >>> } >>> // size now equals the size (in bits) of the type...
2016 Oct 31
0
RFC: PointerType should derive from Type rather than SequentialType
On Mon, Oct 31, 2016 at 1:43 PM Peter Collingbourne <peter at pcc.me.uk> wrote: > Thanks David. I ended up trying this over the weekend (see > https://github.com/llvm-project/llvm-project/compare/master...pcc:pointertype). > It ended up being a net reduction in code size so seems like a useful > cleanup even independent of the typeless pointer work, I'll see if I can > send a patch to the list. > > FWIW I think this directly helps towards the migration because we would > have a clearer idea of...
2011 Aug 24
1
[LLVMdev] proposal: add macro expansion of for-loop to TableGen
...ce name (global, constant, and etc.). I believe a for-loop can make it much more readable. (defining memory space patterns in PTXInstrInfo.td for each memory space) ---------------------------------------- def load_global : PatFrag<(ops node:$ptr), (load node:$ptr), [{  const Value *Src;  const PointerType *PT;  if ((Src = cast<LoadSDNode>(N)->getSrcValue()) &&      (PT = dyn_cast<PointerType>(Src->getType())))    return PT->getAddressSpace() == PTX::GLOBAL;  return false; }]>; def load_constant : PatFrag<(ops node:$ptr), (load node:$ptr), [{  const Value *Src;  con...
2009 Oct 20
4
[LLVMdev] Dereference PointerType?
...am looking at the target data getTypeAllocSize method. Daniel 2009/10/20 Duncan Sands <baldrick at free.fr> > Óscar Fuentes wrote: > >> Daniel Waterworth <da.waterworth at googlemail.com> writes: >> >> [snip] >> >> Use the getElementType method of PointerType. >> >> size_t size; >>>> if (isa<PointerType>(allocated_type)) { >>>> size = sizeof(void*) * 8; >>>> } else { >>>> size = allocated_type->getPrimitiveSizeInBits(); >>>> } >>>> // size now equals the size...
2007 Dec 17
0
[LLVMdev] PointerType API Change
...n dynamically track "undefined" address spaces under the hood is counter to this goal. > On Monday 17 December 2007, Christopher Lamb wrote: >> On Dec 16, 2007, at 10:22 PM, Anton Korobeynikov wrote: >>> Christopher, >>> >>>> The API for getting PointerType objects has just changed to make >>>> Embedded C address space information explicit. The old semantics of >>>> PointerType::get() now apply to PointerType::getUnqual(), which >>>> returns a pointer in the generic address space. PointerType::get() >>>>...
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
...i.e. AllocaInst and GlobalVariable both dereference the pointers automatically. I can cast the value I get from the symbol table to a AllocaInst, of course, in the case where it is one, but this requires a test for one and is just as messy as first getting the type and then testing it for being a PointerType and less general since a GlobalVariable also store its type as a PointerType which point to the actual type. They, unfortunately, do not share a common superclass other than Value itself. - Curtis On May 28, 2010, at 1:06 AM, Nick Lewycky wrote: > Curtis Faith wrote: >> Is there a reco...
2008 Sep 18
2
[LLVMdev] store addrspace qualifier
...al); const SDValue& dstPtr = storeOp->getBasePtr(); const SrcValueSDNode* svdstVal = cast<SrcValueSDNode>(dstPtr.Val); const Value* dstVal = svdstVal->getValue(); int addressSpace = ADDRESS_NONE; const Type* dstType = dstVal->getType(); if (isa<PointerType>(dstType)) { const PointerType* ptrType = cast<PointerType>(dstType); addressSpace = ptrType->getAddressSpace(); } printf("Addr: %d\n", addressSpace); SDValue Res; .... return Res; } Any idea what I'm doing wrong or how I can get th...
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
...t; and bogus. Consider the following: > > %1 = alloca i32* ; %1 is of type i32**, dereferenced it becomes a type i32* > and > ; the size of that is sizeof(void *) bytes What Duncan says is that any valid method for obtaining the size of a Type should work for a PointerType, which is just another kind of Type. >>>>> if (isa<PointerType>(allocated_type)) { >>>>> size = sizeof(void*) * 8; >>>>> } else { >>>>> size = allocated_type->getPrimitiveSizeInBits(); >>>>> } >>>>&gt...