Home | History | Annotate | Download | only in Analysis

Lines Matching refs:IncV

854 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV,
856 if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) ||
857 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV)))
863 for (User::op_iterator OI = IncV->op_begin()+1,
864 OE = IncV->op_end(); OI != OE; ++OI)
870 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
871 if (!IncV)
874 if (IncV->mayHaveSideEffects())
877 if (IncV != PN)
880 return isNormalAddRecExprPHI(PN, IncV, L);
892 Instruction *SCEVExpander::getIVIncOperand(Instruction *IncV,
895 if (IncV == InsertPos)
898 switch (IncV->getOpcode()) {
904 Instruction *OInst = dyn_cast<Instruction>(IncV->getOperand(1));
906 return dyn_cast<Instruction>(IncV->getOperand(0));
910 return dyn_cast<Instruction>(IncV->getOperand(0));
912 for (Instruction::op_iterator I = IncV->op_begin()+1, E = IncV->op_end();
928 if (IncV->getNumOperands() != 2)
930 unsigned AS = cast<PointerType>(IncV->getType())->getAddressSpace();
931 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS)
932 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS))
936 return dyn_cast<Instruction>(IncV->getOperand(0));
943 bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos) {
944 if (SE.DT->dominates(IncV, InsertPos))
947 // InsertPos must itself dominate IncV so that IncV's new position satisfies
950 || !SE.DT->dominates(InsertPos->getParent(), IncV->getParent()))
956 Instruction *Oper = getIVIncOperand(IncV, InsertPos, /*allowScale*/true);
959 // IncV is safe to hoist.
960 IVIncs.push_back(IncV);
961 IncV = Oper;
962 if (SE.DT->dominates(IncV, InsertPos))
977 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV,
979 for(Instruction *IVOper = IncV;
994 Value *IncV;
1004 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN);
1005 if (IncV->getType() != PN->getType()) {
1006 IncV = Builder.CreateBitCast(IncV, PN->getType());
1007 rememberInstruction(IncV);
1010 IncV = useSubtract ?
1013 rememberInstruction(IncV);
1015 return IncV;
1082 Instruction *IncV = nullptr;
1123 IncV = TempIncV;
1137 IncV = TempIncV;
1146 hoistBeforePos(SE.DT, IncV, IVIncInsertPos, AddRecPhiMatch);
1152 rememberInstruction(IncV);
1215 Value *IncV = expandIVInc(PN, StepV, L, ExpandTy, IntTy, useSubtract);
1216 if (isa<OverflowingBinaryOperator>(IncV)) {
1218 cast<BinaryOperator>(IncV)->setHasNoUnsignedWrap();
1220 cast<BinaryOperator>(IncV)->setHasNoSignedWrap();
1222 PN->addIncoming(IncV, Pred);