Lines Matching refs:GEP
464 void visitGetElementPtrInst(GetElementPtrInst &GEP);
3303 void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
3304 Type *TargetTy = GEP.getPointerOperandType()->getScalarType();
3307 "GEP base pointer is not a vector or a vector of pointers", &GEP);
3308 Assert(GEP.getSourceElementType()->isSized(), "GEP into unsized type!", &GEP);
3310 SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
3313 "GEP indexes must be integers", &GEP);
3315 GetElementPtrInst::getIndexedType(GEP.getSourceElementType(), Idxs);
3316 Assert(ElTy, "Invalid indices for GEP pointer type!", &GEP);
3318 Assert(GEP.getType()->isPtrOrPtrVectorTy() &&
3319 GEP.getResultElementType() == ElTy,
3320 "GEP is not of right type for indices!", &GEP, ElTy);
3322 if (GEP.getType()->isVectorTy()) {
3324 unsigned GEPWidth = GEP.getType()->getVectorNumElements();
3325 if (GEP.getPointerOperandType()->isVectorTy())
3326 Assert(GEPWidth == GEP.getPointerOperandType()->getVectorNumElements(),
3327 "Vector GEP result width doesn't match operand's", &GEP);
3332 Assert(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP);
3335 "All GEP indices should be of integer type");
3339 if (auto *PTy = dyn_cast<PointerType>(GEP.getType())) {
3340 Assert(GEP.getAddressSpace() == PTy->getAddressSpace(),
3341 "GEP address space doesn't match type", &GEP);
3344 visitInstruction(GEP);