Lines Matching refs:Instruction
32 bool RecurrenceDescriptor::areAllUsesIn(Instruction *I, in areAllUsesIn()
33 SmallPtrSetImpl<Instruction *> &Set) { in areAllUsesIn()
35 if (!Set.count(dyn_cast<Instruction>(Use))) in areAllUsesIn()
68 static Instruction *lookThroughAnd(PHINode *Phi, Type *&RT, in lookThroughAnd()
69 SmallPtrSetImpl<Instruction *> &Visited, in lookThroughAnd()
70 SmallPtrSetImpl<Instruction *> &CI) { in lookThroughAnd()
75 Instruction *I, *J = cast<Instruction>(Phi->use_begin()->getUser()); in lookThroughAnd()
93 static std::pair<Type *, bool> computeRecurrenceType(Instruction *Exit, in computeRecurrenceType()
139 static void collectCastInstrs(Loop *TheLoop, Instruction *Exit, in collectCastInstrs()
141 SmallPtrSetImpl<Instruction *> &Casts, in collectCastInstrs()
144 SmallVector<Instruction *, 8> Worklist; in collectCastInstrs()
145 SmallPtrSet<Instruction *, 8> Visited; in collectCastInstrs()
150 Instruction *Val = Worklist.pop_back_val(); in collectCastInstrs()
173 if (auto *I = dyn_cast<Instruction>(O)) in collectCastInstrs()
181 static bool checkOrderedReduction(RecurKind Kind, Instruction *ExactFPMathInst, in checkOrderedReduction()
182 Instruction *Exit, PHINode *Phi) { in checkOrderedReduction()
187 if (Kind == RecurKind::FAdd && Exit->getOpcode() != Instruction::FAdd) in checkOrderedReduction()
232 Instruction *ExitInstruction = nullptr; in AddReductionVar()
256 SmallPtrSet<Instruction *, 4> CastInsts; in AddReductionVar()
258 Instruction *Start = Phi; in AddReductionVar()
261 SmallPtrSet<Instruction *, 8> VisitedInsts; in AddReductionVar()
262 SmallVector<Instruction *, 8> Worklist; in AddReductionVar()
291 Instruction *ExactFPMathInst = nullptr; in AddReductionVar()
313 Instruction *Cur = Worklist.pop_back_val(); in AddReductionVar()
368 !VisitedInsts.count(dyn_cast<Instruction>(Cur->getOperand(0)))) in AddReductionVar()
432 SmallVector<Instruction *, 8> NonPHIs; in AddReductionVar()
433 SmallVector<Instruction *, 8> PHIs; in AddReductionVar()
435 Instruction *UI = cast<Instruction>(U); in AddReductionVar()
534 ExitInstruction = cast<Instruction>(IntermediateStore->getValueOperand()); in AddReductionVar()
629 Instruction *I, InstDesc &Prev) { in isAnyOfPattern()
663 RecurrenceDescriptor::isMinMaxPattern(Instruction *I, RecurKind Kind, in isMinMaxPattern()
723 RecurrenceDescriptor::isConditionalRdxPattern(RecurKind Kind, Instruction *I) { in isConditionalRdxPattern()
741 Instruction *I1 = in isConditionalRdxPattern()
742 isa<PHINode>(*TrueVal) ? dyn_cast<Instruction>(FalseVal) in isConditionalRdxPattern()
743 : dyn_cast<Instruction>(TrueVal); in isConditionalRdxPattern()
757 Instruction *IPhi = isa<PHINode>(*Op1) ? dyn_cast<Instruction>(Op1) in isConditionalRdxPattern()
758 : dyn_cast<Instruction>(Op2); in isConditionalRdxPattern()
767 Instruction *I, RecurKind Kind, in isRecurrenceInstr()
773 case Instruction::PHI: in isRecurrenceInstr()
775 case Instruction::Sub: in isRecurrenceInstr()
776 case Instruction::Add: in isRecurrenceInstr()
778 case Instruction::Mul: in isRecurrenceInstr()
780 case Instruction::And: in isRecurrenceInstr()
782 case Instruction::Or: in isRecurrenceInstr()
784 case Instruction::Xor: in isRecurrenceInstr()
786 case Instruction::FDiv: in isRecurrenceInstr()
787 case Instruction::FMul: in isRecurrenceInstr()
790 case Instruction::FSub: in isRecurrenceInstr()
791 case Instruction::FAdd: in isRecurrenceInstr()
794 case Instruction::Select: in isRecurrenceInstr()
799 case Instruction::FCmp: in isRecurrenceInstr()
800 case Instruction::ICmp: in isRecurrenceInstr()
801 case Instruction::Call: in isRecurrenceInstr()
825 Instruction *I, SmallPtrSetImpl<Instruction *> &Insts, in hasMultipleUsesOf()
829 if (Insts.count(dyn_cast<Instruction>(U))) in hasMultipleUsesOf()
969 auto *Previous = dyn_cast<Instruction>(Phi->getIncomingValueForBlock(Latch)); in isFixedOrderRecurrence()
981 Previous = dyn_cast<Instruction>(PrevPhi->getIncomingValueForBlock(Latch)); in isFixedOrderRecurrence()
995 SmallVector<Instruction *, 8> WorkList; in isFixedOrderRecurrence()
996 auto TryToPushSinkCandidate = [&](Instruction *SinkCandidate) { in isFixedOrderRecurrence()
1025 Instruction *Current = WorkList.pop_back_val(); in isFixedOrderRecurrence()
1027 if (!TryToPushSinkCandidate(cast<Instruction>(User))) in isFixedOrderRecurrence()
1099 return Instruction::Add; in getOpcode()
1101 return Instruction::Mul; in getOpcode()
1103 return Instruction::Or; in getOpcode()
1105 return Instruction::And; in getOpcode()
1107 return Instruction::Xor; in getOpcode()
1109 return Instruction::FMul; in getOpcode()
1112 return Instruction::FAdd; in getOpcode()
1118 return Instruction::ICmp; in getOpcode()
1124 return Instruction::FCmp; in getOpcode()
1130 SmallVector<Instruction *, 4>
1132 SmallVector<Instruction *, 4> ReductionOperations; in getReductionOpChain()
1151 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) in getReductionOpChain()
1154 auto getNextInstruction = [&](Instruction *Cur) -> Instruction * { in getReductionOpChain()
1156 Instruction *UI = cast<Instruction>(User); in getReductionOpChain()
1159 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) { in getReductionOpChain()
1170 auto isCorrectOpcode = [&](Instruction *Cur) { in getReductionOpChain()
1171 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) { in getReductionOpChain()
1185 Instruction *RdxInstr = LoopExitInstr; in getReductionOpChain()
1190 Instruction *Inc0 = dyn_cast<Instruction>(ExitPhi->getIncomingValue(0)); in getReductionOpChain()
1191 Instruction *Inc1 = dyn_cast<Instruction>(ExitPhi->getIncomingValue(1)); in getReductionOpChain()
1193 Instruction *Chain = nullptr; in getReductionOpChain()
1217 Instruction *Cur = getNextInstruction(Phi); in getReductionOpChain()
1235 SmallVectorImpl<Instruction *> *Casts) in InductionDescriptor()
1258 (InductionBinOp->getOpcode() == Instruction::FAdd || in InductionDescriptor()
1259 InductionBinOp->getOpcode() == Instruction::FSub))) && in InductionDescriptor()
1305 if (BOp->getOpcode() == Instruction::FAdd) { in isFPInductionPHI()
1310 } else if (BOp->getOpcode() == Instruction::FSub) in isFPInductionPHI()
1318 if (auto *I = dyn_cast<Instruction>(Addend)) in isFPInductionPHI()
1363 SmallVectorImpl<Instruction *> &CastInsts) { in getCastsForInductionPHI()
1406 auto *Inst = dyn_cast<Instruction>(Val); in getCastsForInductionPHI()
1427 Inst = dyn_cast<Instruction>(Val); in getCastsForInductionPHI()
1469 SmallVector<Instruction *, 2> Casts; in isInductionPHI()
1480 SmallVectorImpl<Instruction *> *CastsToIgnore) { in isInductionPHI()