Lines Matching refs:GEP
44 bool GEPIndexesStructType(const llvm::GetElementPtrInst *GEP) { in GEPIndexesStructType() argument
45 for (llvm::gep_type_iterator GTI = gep_type_begin(GEP), in GEPIndexesStructType()
46 GTE = gep_type_end(GEP); in GEPIndexesStructType()
69 llvm::Value *computeGEPOffset(llvm::GetElementPtrInst *GEP) { in computeGEPOffset() argument
72 for (llvm::gep_type_iterator GTI = gep_type_begin(GEP), in computeGEPOffset()
73 GTE = gep_type_end(GEP); in computeGEPOffset()
87 Offset = incrementOffset(Offset, Incr, GEP); in computeGEPOffset()
95 EltSize, "", GEP); in computeGEPOffset()
96 Offset = incrementOffset(Offset, Incr, GEP); in computeGEPOffset()
103 void translateGEP(llvm::GetElementPtrInst *GEP) { in translateGEP() argument
106 GEP->getPointerOperand(), in translateGEP()
109 GEP); in translateGEP()
110 llvm::Value *Indices[1] = {computeGEPOffset(GEP)}; in translateGEP()
115 "int8ptr.indexed", GEP); in translateGEP()
116 Int8PtrGEP->setIsInBounds(GEP->isInBounds()); in translateGEP()
120 Int8PtrGEP, GEP->getType(), "to.orig.geptype", GEP); in translateGEP()
122 GEP->replaceAllUsesWith(OutCast); in translateGEP()
147 if (auto *GEP = llvm::dyn_cast<llvm::GetElementPtrInst>(&I)) { in runOnFunction() local
148 if (GEPIndexesStructType(GEP)) { in runOnFunction()
149 GEPsToHandle.push_back(GEP); in runOnFunction()
155 for (auto *GEP: GEPsToHandle) { in runOnFunction() local
157 translateGEP(GEP); in runOnFunction()
159 GEP->eraseFromParent(); in runOnFunction()