Home | History | Annotate | Download | only in Analysis

Lines Matching refs:IncV

863 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV,
865 if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) ||
866 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV)))
872 for (User::op_iterator OI = IncV->op_begin()+1,
873 OE = IncV->op_end(); OI != OE; ++OI)
879 IncV = dyn_cast<Instruction>(IncV->getOperand(0));
880 if (!IncV)
883 if (IncV->mayHaveSideEffects())
886 if (IncV != PN)
889 return isNormalAddRecExprPHI(PN, IncV, L);
901 Instruction *SCEVExpander::getIVIncOperand(Instruction *IncV,
904 if (IncV == InsertPos)
907 switch (IncV->getOpcode()) {
913 Instruction *OInst = dyn_cast<Instruction>(IncV->getOperand(1));
915 return dyn_cast<Instruction>(IncV->getOperand(0));
919 return dyn_cast<Instruction>(IncV->getOperand(0));
921 for (Instruction::op_iterator I = IncV->op_begin()+1, E = IncV->op_end();
937 if (IncV->getNumOperands() != 2)
939 unsigned AS = cast<PointerType>(IncV->getType())->getAddressSpace();
940 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS)
941 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS))
945 return dyn_cast<Instruction>(IncV->getOperand(0));
952 bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos) {
953 if (SE.DT->dominates(IncV, InsertPos))
956 // InsertPos must itself dominate IncV so that IncV's new position satisfies
959 || !SE.DT->dominates(InsertPos->getParent(), IncV->getParent()))
965 Instruction *Oper = getIVIncOperand(IncV, InsertPos, /*allowScale*/true);
968 // IncV is safe to hoist.
969 IVIncs.push_back(IncV);
970 IncV = Oper;
971 if (SE.DT->dominates(IncV, InsertPos))
986 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV,
988 for(Instruction *IVOper = IncV;
1003 Value *IncV;
1013 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN);
1014 if (IncV->getType() != PN->getType()) {
1015 IncV = Builder.CreateBitCast(IncV, PN->getType());
1016 rememberInstruction(IncV);
1019 IncV = useSubtract ?
1022 rememberInstruction(IncV);
1024 return IncV;
1048 Instruction *IncV =
1052 if (!isExpandedAddRecExprPHI(PN, IncV, L))
1054 if (L == IVIncInsertLoop && !hoistIVInc(IncV, IVIncInsertPos))
1058 if (!isNormalAddRecExprPHI(PN, IncV, L))
1062 if (SE.DT->dominates(IncV, IVIncInsertPos))
1066 IncV->moveBefore(IVIncInsertPos);
1067 IVIncInsertPos = IncV;
1068 IncV = cast<Instruction>(IncV->getOperand(0));
1069 } while (IncV != PN);
1075 rememberInstruction(IncV);
1139 Value *IncV = expandIVInc(PN, StepV, L, ExpandTy, IntTy, useSubtract);
1141 PN->addIncoming(IncV, Pred);