Home | History | Annotate | Download | only in Analysis

Lines Matching defs:IncV

861 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV,
863 if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) ||
864 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV)))
870 for (User::op_iterator OI = IncV->op_begin()+1,
871 OE = IncV->op_end(); OI != OE; ++OI)
877 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
878 if (!IncV)
881 if (IncV->mayHaveSideEffects())
884 if (IncV != PN)
887 return isNormalAddRecExprPHI(PN, IncV, L);
899 Instruction *SCEVExpander::getIVIncOperand(Instruction *IncV,
902 if (IncV == InsertPos)
905 switch (IncV->getOpcode()) {
911 Instruction *OInst = dyn_cast<Instruction>(IncV->getOperand(1));
913 return dyn_cast<Instruction>(IncV->getOperand(0));
917 return dyn_cast<Instruction>(IncV->getOperand(0));
919 for (Instruction::op_iterator I = IncV->op_begin()+1, E = IncV->op_end();
935 if (IncV->getNumOperands() != 2)
937 unsigned AS = cast<PointerType>(IncV->getType())->getAddressSpace();
938 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS)
939 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS))
943 return dyn_cast<Instruction>(IncV->getOperand(0));
950 bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos) {
951 if (SE.DT->dominates(IncV, InsertPos))
954 // InsertPos must itself dominate IncV so that IncV's new position satisfies
957 || !SE.DT->dominates(InsertPos->getParent(), IncV->getParent()))
963 Instruction *Oper = getIVIncOperand(IncV, InsertPos, /*allowScale*/true);
966 // IncV is safe to hoist.
967 IVIncs.push_back(IncV);
968 IncV = Oper;
969 if (SE.DT->dominates(IncV, InsertPos))
984 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV,
986 for(Instruction *IVOper = IncV;
1001 Value *IncV;
1011 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN);
1012 if (IncV->getType() != PN->getType()) {
1013 IncV = Builder.CreateBitCast(IncV, PN->getType());
1014 rememberInstruction(IncV);
1017 IncV = useSubtract ?
1020 rememberInstruction(IncV);
1022 return IncV;
1046 Instruction *IncV =
1050 if (!isExpandedAddRecExprPHI(PN, IncV, L))
1052 if (L == IVIncInsertLoop && !hoistIVInc(IncV, IVIncInsertPos))
1056 if (!isNormalAddRecExprPHI(PN, IncV, L))
1060 if (SE.DT->dominates(IncV, IVIncInsertPos))
1064 IncV->moveBefore(IVIncInsertPos);
1065 IVIncInsertPos = IncV;
1066 IncV = cast<Instruction>(IncV->getOperand(0));
1067 } while (IncV != PN);
1073 rememberInstruction(IncV);
1137 Value *IncV = expandIVInc(PN, StepV, L, ExpandTy, IntTy, useSubtract);
1138 if (isa<OverflowingBinaryOperator>(IncV)) {
1140 cast<BinaryOperator>(IncV)->setHasNoUnsignedWrap();
1142 cast<BinaryOperator>(IncV)->setHasNoSignedWrap();
1144 PN->addIncoming(IncV, Pred);