search for: gepi

Displaying 20 results from an estimated 29 matches for "gepi".

Did you mean: gep
2005 Jul 29
0
[LLVMdev] patch for pointer-to-array conversion
...std::set<Instruction*> &DeadInsts) { - assert(PN->getNumIncomingValues() == 2 && "Noncanonicalized loop!"); - unsigned PreheaderIdx = PN->getBasicBlockIndex(Preheader); - unsigned BackedgeIdx = PreheaderIdx^1; - if (GetElementPtrInst *GEPI = - dyn_cast<GetElementPtrInst>(PN->getIncomingValue(BackedgeIdx))) - if (GEPI->getOperand(0) == PN) { - assert(GEPI->getNumOperands() == 2 && "GEP types must mismatch!"); - +static std::pair<Value*,Value*> transformPointerRecurrence( +...
2009 May 14
2
[LLVMdev] Fusing GEPIs
Hi, Is there any standard pass or something that can fuse chained GEPIs? I.e. turning b = getelementptr a, 10, 1 c = getelementptr b, 0, 3 d = getelementptr c, 0, 5 into: d = getelementptr a, 10, 1, 3, 5 In our case this would greatly simplify some analysis passes, at the moment we have to trace back a gepi-chain and extract all the indices manually (the origi...
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
...IndVarSimplify::EliminatePointerRecurrence(PHINode *PN, --- > void IndVarSimplify::EliminatePointerRecurrence(LoopInfo *LI, Loop *L, PHINode *PN, 366a367 > Value *saved_trip_count = L->getTripCount(); // save before it's clobbered 392c393,408 < --- > std::cerr << "\tGEPI: " << *GEPI; > if (PHINode *phi = dyn_cast<PHINode>(GEPI->getOperand(0))) > { > if (ConstantExpr *CE = dyn_cast<ConstantExpr>(phi->getIncomingValue(0))) > if (CE->getOpcode() == Instruction::GetElementPtr) // We w...
2010 May 05
2
[LLVMdev] How to cast an integer array to an integer pointer? (user question)
...lVariable *GGV = new GlobalVariable( *M, ArrayType::get(Type::getInt8Ty(Context), 4), true, GlobalValue::PrivateLinkage, llvm::ConstantArray::get(ArrayType::get(Type::getInt8Ty(Context), 4), Ivars), "g_value_mine", 0, false, 0/*AddrSpace*/); // ptr GetElementPtrInst *gepi = GetElementPtrInst::CreateInBounds( GGV, ConstantInt::get(Type::getInt32Ty(Context), 0), "zzz", BB ); // func call Function *PutsF = cast<Function>(M->getOrInsertFunction("puts", Type::getVoidTy(Context),...
2008 Apr 29
0
[LLVMdev] [PATCH] use-diet for review
...t;", Instruction *InsertBefore = 0) { - return new(2/*FIXME*/) GetElementPtrInst(Ptr, Idx, Name, InsertBefore); + return new(2) GetElementPtrInst(Ptr, Idx, Name, InsertBefore); } What is the magic "2"? +GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) + : Instruction(reinterpret_cast<const Type*>(GEPI.getType()), GetElementPtr, + OperandTraits<GetElementPtrInst>::op_end(this) - GEPI.getNumOperands(), + GEPI.getNumOperands()) { + Use *OL = OperandList; + Use *GEPIOL = GEPI.OperandList; + for (uns...
2005 Jul 28
0
[LLVMdev] help with pointer-to-array conversion
...Node *PN, > --- >> void IndVarSimplify::EliminatePointerRecurrence(LoopInfo *LI, Loop *L, > PHINode *PN, > 366a367 >> Value *saved_trip_count = L->getTripCount(); // save before it's > clobbered > 392c393,408 > < > --- >> std::cerr << "\tGEPI: " << *GEPI; >> if (PHINode *phi = dyn_cast<PHINode>(GEPI->getOperand(0))) >> { >> if (ConstantExpr *CE = > dyn_cast<ConstantExpr>(phi->getIncomingValue(0))) >> if (CE->getOpcode() == Instruction::Ge...
2019 Mar 27
2
getelementptr inbounds with offset 0
...t; > I see. Is there a quick answer to the questions why you need inbounds > GEPs in that case? Can't you just use non-inbounds GEPs if you know you > might not have a valid base ptr and "optimize" it to inbounds once that > is proven? You mean on the Rust side? We emit GEPi for field accesses and array indexing. We cannot always statically determine if this is happening for a ZST or not. At the same time, given that no memory access ever happens for a ZST, allocating a ZST (Box::new in Rust, think of it like new in C++) does not actually allocate any memory, it just...
2019 Apr 10
2
getelementptr inbounds with offset 0
...o the questions why you need inbounds >>> GEPs in that case? Can't you just use non-inbounds GEPs if you know you >>> might not have a valid base ptr and "optimize" it to inbounds once that >>> is proven? >> >> You mean on the Rust side? We emit GEPi for field accesses and array indexing. >> We cannot always statically determine if this is happening for a ZST or not. >> At the same time, given that no memory access ever happens for a ZST, allocating >> a ZST (Box::new in Rust, think of it like new in C++) does not actually al...
2008 Apr 29
5
[LLVMdev] [PATCH] use-diet for review
Hi all, I have reported more than enough about the space savings achieved and the associated costs, here comes the current patch for review. Since this one is substantially smaller than the previous one, I did not cut it in pieces. The front part is about headers and the rest the .cpp and other files. Cheers, Gabor -------------- next part -------------- An embedded and charset-unspecified
2019 Mar 15
2
getelementptr inbounds with offset 0
...doe snot know anything about. Just imagine some embedded project writing to well-known address 0xDeadCafe because there is a hardware register there. So, the thinking here is: LLVM cannot exclude the possibility of an object of size 0 existing at any given address. The pointer returned by "GEPi p 0" then would be one-past-the-end of such a 0-sized object. Thus, "GEPi p 0" is the identitiy function for any p, it will not return poison. > Now if that might cause any problems, e.g., if LLVM is able to act on > this fact, depends on various factors including what you do...
2008 Apr 04
2
[LLVMdev] InstCombine Question
I am confused by this bit of code in instcombine: 09789 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { 09790 const Value *GEPI0 = GEPI->getOperand(0); 09791 // TODO: Consider a target hook for valid address spaces for this xform. 09792 if (isa<ConstantPointerNull>(GEPI0) && 09793 cast<PointerType>(GEPI0->getTyp...
2014 Dec 09
2
[LLVMdev] Question on equivalence of pointer types
.... For example, this code is in InstCombine where we assume that loading null is undefined, but only for addrspace(0). Whether other address spaces trap or give undefined behaviour on loading null is target dependent. Thanks, Pete // load(gep null, ...) -> unreachable if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { const Value *GEPI0 = GEPI->getOperand(0); // TODO: Consider a target hook for valid address spaces for this xform. if (isa<ConstantPointerNull>(GEPI0) && GEPI->getPointerAddressSpace() == 0){ // Insert a new store to n...
2019 Mar 26
2
getelementptr inbounds with offset 0
Hi Johannes, >> So, the thinking here is: LLVM cannot exclude the possibility of an >> object of size 0 existing at any given address. The pointer returned >> by "GEPi p 0" then would be one-past-the-end of such a 0-sized object. >> Thus, "GEPi p 0" is the identitiy function for any p, it will not >> return poison. > > I don't see the problem. The behavior I hope we want and implement is: > > Either LLVM knows that %p...
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
...t;Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI = dyn_cast<GetElementPtrInst>(operandI)) { Out << "*** operand is a gep instruction ********"; if (const ArrayType *ar = dyn_cast<ArrayType>(gepI->getPointerOperandType()->getElementType())) hi=ar->getNumElement...
2004 Nov 15
0
[LLVMdev] Fixes for windows version
...ScalarReplAggregates.cpp 14 Nov 2004 05:00:19 -0000 1.28 > +++ lib/Transforms/Scalar/ScalarReplAggregates.cpp 15 Nov 2004 08:38:35 -0000 > @@ -336,7 +336,7 @@ > for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end(); > UI != E; ) { > GetElementPtrInst *GEPI = cast<GetElementPtrInst>(*UI++); > - gep_type_iterator I = gep_type_begin(GEPI), E = gep_type_end(GEPI); > + gep_type_iterator I = gep_type_begin(GEPI); > ++I; > > if (const ArrayType *AT = dyn_cast<ArrayType>(*I)) { > Index: win32/Support/Support.vc...
2004 Nov 15
2
[LLVMdev] Fixes for windows version
Hi, when I updated the sources today there were several small problems that stopped the windows version from compiling, here are the patches m. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: win32patches.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041115/34634455/attachment.txt>
2014 Dec 05
3
[LLVMdev] Question on equivalence of pointer types
Is copy.0 semantically equivalent to copy.1 in the following example? define void @copy.0(i8 addrspace(1)* addrspace(1)* %src, i8 addrspace(1)* addrspace(1)* %dst) { entry: %val = load i8 addrspace(1)* addrspace(1)* %src store i8 addrspace(1)* %val, i8 addrspace(1)* addrspace(1)* %dst ret void } define void @copy.1(i8 addrspace(1)* addrspace(1)* %src, i8 addrspace(1)* addrspace(1)* %dst)
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
...and(0))) > { Out<< "*** operand 0 is a constant ******"; > if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) > { Out<< "********operand is an instruction ****"; > if (GetElementPtrInst *gepI = > dyn_cast<GetElementPtrInst>(operandI)) > { Out<< "*** operand is a gep instruction ********"; > if (const ArrayType *ar = > dyn_cast<ArrayType>(gepI->getPointerOperandType()->getElementType())) >...
2013 Nov 19
0
[R-pkgs] Introducing pedgene 1.2 on CRAN
...digree data, as described in our recent paper: Schaid, D. J., McDonnell, S. K., Sinnwell, J. P. and Thibodeau, S. N. (2013), Multiple Genetic Variant Association Testing by Collapsing and Kernel Methods With Pedigree or Population Structured Data. Genet. Epidemiol., 37: 409-418. doi: 10.1002/gepi.21727 LINK: http://onlinelibrary.wiley.com/doi/10.1002/gepi.21727/abstract We have received some valuable feedback, and welcome more. Best, Jason Sinnwell, MS Mayo Clinic Division of Biomedical Statistics and Informatics 200 1st St SW Rochester MN 55905 _______________________________________...
2013 Nov 19
0
Introducing pedgene 1.2 on CRAN
...digree data, as described in our recent paper: Schaid, D. J., McDonnell, S. K., Sinnwell, J. P. and Thibodeau, S. N. (2013), Multiple Genetic Variant Association Testing by Collapsing and Kernel Methods With Pedigree or Population Structured Data. Genet. Epidemiol., 37: 409-418. doi: 10.1002/gepi.21727 LINK: http://onlinelibrary.wiley.com/doi/10.1002/gepi.21727/abstract We have received some valuable feedback, and welcome more. Best, Jason Sinnwell, MS Mayo Clinic Division of Biomedical Statistics and Informatics 200 1st St SW Rochester MN 55905 _______________________________________...