Lines Matching refs:IncV
849 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV,
851 if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) ||
852 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV)))
858 for (User::op_iterator OI = IncV->op_begin()+1,
859 OE = IncV->op_end(); OI != OE; ++OI)
865 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
866 if (!IncV)
869 if (IncV->mayHaveSideEffects())
872 if (IncV != PN)
875 return isNormalAddRecExprPHI(PN, IncV, L);
883 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV,
885 switch (IncV->getOpcode()) {
889 return IncV->getOperand(0) == PN
890 && L->isLoopInvariant(IncV->getOperand(1));
892 IncV = dyn_cast<GetElementPtrInst>(IncV->getOperand(0));
893 if (!IncV)
899 for (Instruction::op_iterator I = IncV->op_begin()+1, E = IncV->op_end();
905 if (IncV->getNumOperands() != 2)
907 unsigned AS = cast<PointerType>(IncV->getType())->getAddressSpace();
908 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS)
909 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS))
914 for (User::op_iterator OI = IncV->op_begin()+1,
915 OE = IncV->op_end(); OI != OE; ++OI)
922 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
923 if (IncV && IncV->getOpcode() == Instruction::BitCast)
924 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
925 return IncV == PN;
953 Instruction *IncV =
957 if (!isExpandedAddRecExprPHI(PN, IncV, L))
961 if (!isNormalAddRecExprPHI(PN, IncV, L))
968 rememberInstruction(IncV);
971 if (SE.DT->dominates(IncV, IVIncInsertPos))
975 IncV->moveBefore(IVIncInsertPos);
976 IVIncInsertPos = IncV;
977 IncV = cast<Instruction>(IncV->getOperand(0));
978 } while (IncV != PN);
1032 Value *IncV;
1042 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN);
1043 if (IncV->getType() != PN->getType()) {
1044 IncV = Builder.CreateBitCast(IncV, PN->getType());
1045 rememberInstruction(IncV);
1048 IncV = isNegative ?
1051 rememberInstruction(IncV);
1053 PN->addIncoming(IncV, Pred);
1484 /// - IncV operands dominate InsertPos and
1485 /// - InsertPos dominates IncV
1487 /// Meeting the second condition means that we don't need to check all of IncV's
1495 bool SCEVExpander::hoistStep(Instruction *IncV, Instruction *InsertPos,
1497 if (DT->dominates(IncV, InsertPos))
1500 if (!DT->dominates(InsertPos->getParent(), IncV->getParent()))
1503 if (IncV->mayHaveSideEffects())
1506 // Attempt to hoist IncV
1507 for (User::op_iterator OI = IncV->op_begin(), OE = IncV->op_end();
1513 IncV->moveBefore(InsertPos);