Lines Matching refs:IncV
825 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV, in isNormalAddRecExprPHI() argument
827 if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) || in isNormalAddRecExprPHI()
828 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV))) in isNormalAddRecExprPHI()
834 for (User::op_iterator OI = IncV->op_begin()+1, in isNormalAddRecExprPHI()
835 OE = IncV->op_end(); OI != OE; ++OI) in isNormalAddRecExprPHI()
841 IncV = dyn_cast<Instruction>(IncV->getOperand(0)); in isNormalAddRecExprPHI()
842 if (!IncV) in isNormalAddRecExprPHI()
845 if (IncV->mayHaveSideEffects()) in isNormalAddRecExprPHI()
848 if (IncV != PN) in isNormalAddRecExprPHI()
851 return isNormalAddRecExprPHI(PN, IncV, L); in isNormalAddRecExprPHI()
863 Instruction *SCEVExpander::getIVIncOperand(Instruction *IncV, in getIVIncOperand() argument
866 if (IncV == InsertPos) in getIVIncOperand()
869 switch (IncV->getOpcode()) { in getIVIncOperand()
875 Instruction *OInst = dyn_cast<Instruction>(IncV->getOperand(1)); in getIVIncOperand()
877 return dyn_cast<Instruction>(IncV->getOperand(0)); in getIVIncOperand()
881 return dyn_cast<Instruction>(IncV->getOperand(0)); in getIVIncOperand()
883 for (auto I = IncV->op_begin() + 1, E = IncV->op_end(); I != E; ++I) { in getIVIncOperand()
898 if (IncV->getNumOperands() != 2) in getIVIncOperand()
900 unsigned AS = cast<PointerType>(IncV->getType())->getAddressSpace(); in getIVIncOperand()
901 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS) in getIVIncOperand()
902 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS)) in getIVIncOperand()
906 return dyn_cast<Instruction>(IncV->getOperand(0)); in getIVIncOperand()
913 bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos) { in hoistIVInc() argument
914 if (SE.DT.dominates(IncV, InsertPos)) in hoistIVInc()
920 !SE.DT.dominates(InsertPos->getParent(), IncV->getParent())) in hoistIVInc()
923 if (!SE.LI.movementPreservesLCSSAForm(IncV, InsertPos)) in hoistIVInc()
929 Instruction *Oper = getIVIncOperand(IncV, InsertPos, /*allowScale*/true); in hoistIVInc()
933 IVIncs.push_back(IncV); in hoistIVInc()
934 IncV = Oper; in hoistIVInc()
935 if (SE.DT.dominates(IncV, InsertPos)) in hoistIVInc()
949 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV, in isExpandedAddRecExprPHI() argument
951 for(Instruction *IVOper = IncV; in isExpandedAddRecExprPHI()
966 Value *IncV; in expandIVInc() local
976 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN); in expandIVInc()
977 if (IncV->getType() != PN->getType()) { in expandIVInc()
978 IncV = Builder.CreateBitCast(IncV, PN->getType()); in expandIVInc()
979 rememberInstruction(IncV); in expandIVInc()
982 IncV = useSubtract ? in expandIVInc()
985 rememberInstruction(IncV); in expandIVInc()
987 return IncV; in expandIVInc()
1082 Instruction *IncV = nullptr; in getAddRecExprPHILiterally() local
1124 IncV = TempIncV; in getAddRecExprPHILiterally()
1138 IncV = TempIncV; in getAddRecExprPHILiterally()
1147 hoistBeforePos(&SE.DT, IncV, IVIncInsertPos, AddRecPhiMatch); in getAddRecExprPHILiterally()
1153 rememberInstruction(IncV); in getAddRecExprPHILiterally()
1222 Value *IncV = expandIVInc(PN, StepV, L, ExpandTy, IntTy, useSubtract); in getAddRecExprPHILiterally() local
1224 if (isa<OverflowingBinaryOperator>(IncV)) { in getAddRecExprPHILiterally()
1226 cast<BinaryOperator>(IncV)->setHasNoUnsignedWrap(); in getAddRecExprPHILiterally()
1228 cast<BinaryOperator>(IncV)->setHasNoSignedWrap(); in getAddRecExprPHILiterally()
1230 PN->addIncoming(IncV, Pred); in getAddRecExprPHILiterally()