• Home
  • Raw
  • Download

Lines Matching refs:GEP

220   static Value *Extract(Value *Idx, GetElementPtrInst *GEP,
225 static int64_t Find(Value *Idx, GetElementPtrInst *GEP,
344 bool splitGEP(GetElementPtrInst *GEP);
368 int64_t accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction);
384 bool canonicalizeArrayIndicesToPointerSize(GetElementPtrInst *GEP);
690 Value *ConstantOffsetExtractor::Extract(Value *Idx, GetElementPtrInst *GEP, in Extract() argument
693 ConstantOffsetExtractor Extractor(GEP, DT); in Extract()
697 GEP->isInBounds()); in Extract()
708 int64_t ConstantOffsetExtractor::Find(Value *Idx, GetElementPtrInst *GEP, in Find() argument
711 return ConstantOffsetExtractor(GEP, DT) in Find()
713 GEP->isInBounds()) in Find()
718 GetElementPtrInst *GEP) { in canonicalizeArrayIndicesToPointerSize() argument
720 Type *IntPtrTy = DL->getIntPtrType(GEP->getType()); in canonicalizeArrayIndicesToPointerSize()
721 gep_type_iterator GTI = gep_type_begin(*GEP); in canonicalizeArrayIndicesToPointerSize()
722 for (User::op_iterator I = GEP->op_begin() + 1, E = GEP->op_end(); in canonicalizeArrayIndicesToPointerSize()
727 *I = CastInst::CreateIntegerCast(*I, IntPtrTy, true, "idxprom", GEP); in canonicalizeArrayIndicesToPointerSize()
736 SeparateConstOffsetFromGEP::accumulateByteOffset(GetElementPtrInst *GEP, in accumulateByteOffset() argument
740 gep_type_iterator GTI = gep_type_begin(*GEP); in accumulateByteOffset()
741 for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I, ++GTI) { in accumulateByteOffset()
745 ConstantOffsetExtractor::Find(GEP->getOperand(I), GEP, DT); in accumulateByteOffset()
756 uint64_t Field = cast<ConstantInt>(GEP->getOperand(I))->getZExtValue(); in accumulateByteOffset()
885 bool SeparateConstOffsetFromGEP::splitGEP(GetElementPtrInst *GEP) { in splitGEP() argument
887 if (GEP->getType()->isVectorTy()) in splitGEP()
892 if (GEP->hasAllConstantIndices()) in splitGEP()
895 bool Changed = canonicalizeArrayIndicesToPointerSize(GEP); in splitGEP()
898 int64_t AccumulativeByteOffset = accumulateByteOffset(GEP, NeedsExtraction); in splitGEP()
912 *GEP->getParent()->getParent()); in splitGEP()
913 unsigned AddrSpace = GEP->getPointerAddressSpace(); in splitGEP()
914 if (!TTI.isLegalAddressingMode(GEP->getResultElementType(), in splitGEP()
929 gep_type_iterator GTI = gep_type_begin(*GEP); in splitGEP()
930 for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I, ++GTI) { in splitGEP()
934 Value *OldIdx = GEP->getOperand(I); in splitGEP()
937 ConstantOffsetExtractor::Extract(OldIdx, GEP, UserChainTail, DT); in splitGEP()
940 GEP->setOperand(I, NewIdx); in splitGEP()
968 bool GEPWasInBounds = GEP->isInBounds(); in splitGEP()
969 GEP->setIsInBounds(false); in splitGEP()
975 if (TM && TM->getSubtargetImpl(*GEP->getParent()->getParent())->useAA()) in splitGEP()
976 lowerToSingleIndexGEPs(GEP, AccumulativeByteOffset); in splitGEP()
978 lowerToArithmetics(GEP, AccumulativeByteOffset); in splitGEP()
1014 Instruction *NewGEP = GEP->clone(); in splitGEP()
1015 NewGEP->insertBefore(GEP); in splitGEP()
1021 DL->getTypeAllocSize(GEP->getResultElementType())); in splitGEP()
1022 Type *IntPtrTy = DL->getIntPtrType(GEP->getType()); in splitGEP()
1027 NewGEP = GetElementPtrInst::Create(GEP->getResultElementType(), NewGEP, in splitGEP()
1029 GEP->getName(), GEP); in splitGEP()
1047 Type *I8PtrTy = Type::getInt8PtrTy(GEP->getContext(), in splitGEP()
1048 GEP->getPointerAddressSpace()); in splitGEP()
1049 NewGEP = new BitCastInst(NewGEP, I8PtrTy, "", GEP); in splitGEP()
1051 Type::getInt8Ty(GEP->getContext()), NewGEP, in splitGEP()
1053 GEP); in splitGEP()
1056 if (GEP->getType() != I8PtrTy) in splitGEP()
1057 NewGEP = new BitCastInst(NewGEP, GEP->getType(), GEP->getName(), GEP); in splitGEP()
1060 GEP->replaceAllUsesWith(NewGEP); in splitGEP()
1061 GEP->eraseFromParent(); in splitGEP()
1080 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I++)) in runOnFunction() local
1081 Changed |= splitGEP(GEP); in runOnFunction()