search for: pointerty

Displaying 20 results from an estimated 26 matches for "pointerty".

2011 Dec 03
1
[LLVMdev] New strict-aliasing warning?
When compiling trunk using gcc 4.1.2 on linux/ppc64, I now see a warning that I don't remember seeing previously: llvm[2]: Compiling InlineSpiller.cpp for Release+Asserts build /src/llvm-trunk-dev/include/llvm/ADT/PointerIntPair.h: In member function ‘const PointerTy* llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits>::getAddrOfPointer() const [with PointerTy = void*, unsigned int IntBits = 1u, IntType = bool, PtrTraits = llvm::PointerUnionUIntTraits<llvm::VNInfo*, llvm::SmallVector<llvm::VNInfo*, 4u>*>]’: /src/llvm-trunk-dev/include...
2019 Oct 21
2
How to create vector pointer type?
Hello, Say the original type is Integer i16*,&nbsp; I want to create a v16i16* type to replace it. static Type *getVectorPtr(Type *Ty) { &nbsp; &nbsp; PointerType *PointerTy = dyn_cast<PointerType&gt;(Ty); &nbsp; &nbsp; assert(PointerTy &amp;&amp; "PointerType expected"); &nbsp; &nbsp; unsigned addSpace = PointerTy-&gt;getAddressSpace(); &nbsp; &nbsp; Type *ScalarType = PointerTy-&gt;getElementType...
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
...ting c style "sizeof()", and I did as http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt illuarstrated, and it works find, here's an example of my implementation: auto *p = builder.CreateGEP(structTy, llvm::ConstantPointerNull::get(pointerTy), constint1); auto *size = builder.CreatePtrToInt(p, llvm::IntegerType::get(context, 64)); and type definitions: auto *constint1 = llvm::ConstantInt::get(context, llvm::APInt(64, 1)); auto *int64Ty = llvm::IntegerType::get(context, 64); auto *doubleTy = llvm::Type:...
2019 Jan 29
2
[cfe-dev] Create a BlockAddress array from LLVM Pass
...ckAddress *> tmp; > > Function *fn = ... > > BasicBlock *bb = ... > > > BlockAddress *bba = BlockAddress::get(fn, bb); > > tmp.push_back(bba); > > > GlobalVariable *gvar_ptr_abc = new GlobalVariable( > > /*Module=*/*fn->getParent(), > > /*Type=*/PointerTy, > > /*isConstant=*/false, > > /*Linkage=*/GlobalValue::InternalLinkage, > > /*Initializer=*/0, // has initializer, specified below > > /*Name=*/"labelTracker"); > > gvar_ptr_abc->setAlignment(16); > > Constant *blockItems = ConstantDataArray::get(fn...
2011 Oct 19
2
[LLVMdev] GlobalValue Type
Hi I am wondering why the following variable has a PointerTy. @foo.data = internal addrspace(3) global float 5.000000e+000, align 4 When I do a V->getType()->dump() on the variable its printed as float addrspace(3)* thanks shrey
2015 May 17
2
[LLVMdev] copy value of a global's data field to another global
...t_a_valid_global_; const_ptr_indicesVec=_the_indexes_ llvm::Constant* pConst; pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec); and e.g. use this to repalece an argumrnt of an instruction like: I->setOperand(someArgumentIndex,pConst); However, getGetElementPtr returns a pointerType, which holds the actual type as sub_type. This is a problem when I want to use the data from one global for the initializer of another pGvar->setInitializer(__NeedsAFloatTy_here__); //not pointerTy So what I'm trying to do is copy some data-fields of one global to another. I know...
2004 May 11
3
[LLVMdev] ExecutionEngine/Interpreter/ExternalFunctions.cpp
...quent code. Perhaps there's some subtle usage here I'm missing. I'd like to delete all the code from the start of the function to the end of the loop. Could someone who knows check this, please? Thanks, Reid. static FILE *getFILE(void *Ptr) { static Module *LastMod = 0; static PointerTy IOBBase = 0; static unsigned FILESize; if (LastMod != &TheInterpreter->getModule()) { // Module change or initialize? Module *M = LastMod = &am...
2019 Jan 28
2
Create a BlockAddress array from LLVM Pass
...ve done following to create the same array from LLVM pass. std::vector<BlockAddress *> tmp; Function *fn = ... BasicBlock *bb = ... BlockAddress *bba = BlockAddress::get(fn, bb); tmp.push_back(bba); GlobalVariable *gvar_ptr_abc = new GlobalVariable( /*Module=*/*fn->getParent(), /*Type=*/PointerTy, /*isConstant=*/false, /*Linkage=*/GlobalValue::InternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"labelTracker"); gvar_ptr_abc->setAlignment(16); Constant *blockItems = ConstantDataArray::get(fn->getContext(), tmp); gvar_ptr_abc->setInitializer(blo...
2015 May 18
2
[LLVMdev] copy value of a global's data field to another global
...::Constant* pConst; >> pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec); >> >> and e.g. use this to repalece an argumrnt of an instruction like: >> >> I->setOperand(someArgumentIndex,pConst); >> >> However, getGetElementPtr returns a pointerType, which holds the actual >> type >> as sub_type. >> This is a problem when I want to use the data from one global for the >> initializer of another >> >> pGvar->setInitializer(__NeedsAFloatTy_here__); //not pointerTy >> >> So what I'm tryi...
2007 Nov 22
0
[LLVMdev] Getting the pointer type from a Load/Store SDNode
...ce information into those SDNodes. > > Is Load/StoreSDNode->getSrcValue()->getType() going to do what I want? > If not, I can't see another way of getting to the pointer type. Hrm, the codegen has a couple of interesting crazy issues. For example, it thinks there is a current PointerTy() that is always valid. I see a couple ways to handle this. One is to require that the targets custom expand the load/store to alternate address space at SDISel time. This way they could do any crazy thing they want, including lowering them into intrinsics, etc. -Chris -- http://nondot.org/...
2004 May 11
0
[LLVMdev] ExecutionEngine/Interpreter/ExternalFunctions.cpp
...;m missing. I'd like to delete > all the code from the start of the function to the end of the loop. > > Could someone who knows check this, please? > > Thanks, > > Reid. > > > static FILE *getFILE(void *Ptr) { > static Module *LastMod = 0; > static PointerTy IOBBase = 0; > static unsigned FILESize; > > if (LastMod != &TheInterpreter->getModule()) { // Module change or initialize? > Modul...
2007 Nov 22
2
[LLVMdev] Getting the pointer type from a Load/Store SDNode
I'm digging into this, but I'd like to know if it's feasible to get to the pointer type from a Load/Store SDNode? This would relieve me from having to put the address space information into those SDNodes. Is Load/StoreSDNode->getSrcValue()->getType() going to do what I want? If not, I can't see another way of getting to the pointer type. -- Christopher Lamb
2019 Sep 03
2
SourceMgr vs EXPENSIVE_CHECKS
...::__debug::vector<unsigned int, std::allocator<unsigned int> >*, std::__debug::vector<long unsigned int, std::allocator<long unsigned int> >*> >’ /home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:71:32: required from ‘void llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>::initWithPointer(PointerTy) [with PointerTy = void*; unsigned int IntBits = 2; IntType = int; PtrTraits = llvm::pointer_union_detail::PointerUnionUIntTraits<std::__debug::vector<unsigned char, std::allocator<unsigned char> >*, std::__debug::vect...
2019 Sep 03
2
SourceMgr vs EXPENSIVE_CHECKS
...td::allocator<unsigned int> >*, >> std::__debug::vector<long unsigned int, std::allocator<long unsigned >> int> >*> >’ >> /home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:71:32: >> required from ‘void llvm::PointerIntPair<PointerTy, IntBits, >> IntType, PtrTraits, Info>::initWithPointer(PointerTy) [with PointerTy >> = void*; unsigned int IntBits = 2; IntType = int; PtrTraits = >> llvm::pointer_union_detail::PointerUnionUIntTraits<std::__debug::vector<unsigned >> char, std::allocator<unsigne...
2019 Oct 02
2
SourceMgr vs EXPENSIVE_CHECKS
...t;*, >> >> std::__debug::vector<long unsigned int, std::allocator<long unsigned >> >> int> >*> >’ >> >> /home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:71:32: >> >> required from ‘void llvm::PointerIntPair<PointerTy, IntBits, >> >> IntType, PtrTraits, Info>::initWithPointer(PointerTy) [with PointerTy >> >> = void*; unsigned int IntBits = 2; IntType = int; PtrTraits = >> >> llvm::pointer_union_detail::PointerUnionUIntTraits<std::__debug::vector<unsigned >> >...
2011 Aug 31
0
[LLVMdev] [PATCH] Split init.trampoline into init.trampoline & adjust.trampoline
...ne") { > + Type *ReturnTy = FTy->getReturnType(); > + > + // The new llvm.init.trampoline returns nothing. > + if (ReturnTy->getTypeID() == Type::VoidTyID) Simpler: if (ReturnTy->isVoidTy()) > + break; > + > + assert(ReturnTy->isPointerTy () && > + "old init.trampoline returns a pointer"); Is this worth checking? If not (I think not) you can get rid of the variable ReturnTy altogether. > + assert(FTy->getNumParams() == 3 && "old init.trampoline takes 3 args!"); > +...
2014 Apr 04
2
[LLVMdev] 32bit pointers on a (pure) 64bit architecture
Hi Hal, On Fri, Apr 4, 2014 at 1:22 PM, Hal Finkel <hfinkel at anl.gov> wrote: > [..] > Agreed; but what does your *ISelLowering::getPointerTy() function look > like? Did you override the default implementation? I wonder if returning > MVT::i64 from this function will make things work for you. > > -Hal > > I actually missed implementing this one. But, depending on the testcase that I use, implementing it has no or worse...
2011 Aug 29
3
[LLVMdev] [PATCH] Split init.trampoline into init.trampoline & adjust.trampoline
Hi! Attached patches split init.trampoline into adjust.trampoline and init.trampoline, like in gcc. As mentioned in the previous mail, I've not made a documentation patch, since I'm not sure about what the documented semantics of llvm.adjust.trampoline should be. Thanks! -- Sanjoy Das http://playingwithpointers.com -------------- next part -------------- A non-text attachment was
2004 May 11
1
[LLVMdev] ExecutionEngine/Interpreter/ExternalFunctions.cpp
...rom the start of the function to the end of the loop. > > > > Could someone who knows check this, please? > > > > Thanks, > > > > Reid. > > > > > > static FILE *getFILE(void *Ptr) { > > static Module *LastMod = 0; > > static PointerTy IOBBase = 0; > > static unsigned FILESize; > > > > if (LastMod != &TheInterpreter->getModule()) { // Module change or initialize?...
2018 Apr 05
1
llvm::PointerIntPair -- is this by design or a bug?
I do agree that sign-extension is the right thing to do. Unlike bit-fields, llvm::PointerIntPair has asserts checking that the int value is within range. So if you assign an out of range value, it should fail with an assertion: llvm::PointerIntPair<SomeType*, 3, int> pip; pip.setInt(7); // can be made to fail as the valid range // of signed 3-bit values is [-4:3] The above