Lines Matching refs:Instruction

34 bool RecurrenceDescriptor::areAllUsesIn(Instruction *I,  in areAllUsesIn()
35 SmallPtrSetImpl<Instruction *> &Set) { in areAllUsesIn()
37 if (!Set.count(dyn_cast<Instruction>(Use))) in areAllUsesIn()
70 static Instruction *lookThroughAnd(PHINode *Phi, Type *&RT, in lookThroughAnd()
71 SmallPtrSetImpl<Instruction *> &Visited, in lookThroughAnd()
72 SmallPtrSetImpl<Instruction *> &CI) { in lookThroughAnd()
77 Instruction *I, *J = cast<Instruction>(Phi->use_begin()->getUser()); in lookThroughAnd()
95 static std::pair<Type *, bool> computeRecurrenceType(Instruction *Exit, in computeRecurrenceType()
142 static void collectCastInstrs(Loop *TheLoop, Instruction *Exit, in collectCastInstrs()
144 SmallPtrSetImpl<Instruction *> &Casts, in collectCastInstrs()
147 SmallVector<Instruction *, 8> Worklist; in collectCastInstrs()
148 SmallPtrSet<Instruction *, 8> Visited; in collectCastInstrs()
153 Instruction *Val = Worklist.pop_back_val(); in collectCastInstrs()
176 if (auto *I = dyn_cast<Instruction>(O)) in collectCastInstrs()
184 static bool checkOrderedReduction(RecurKind Kind, Instruction *ExactFPMathInst, in checkOrderedReduction()
185 Instruction *Exit, PHINode *Phi) { in checkOrderedReduction()
190 if (Kind == RecurKind::FAdd && Exit->getOpcode() != Instruction::FAdd) in checkOrderedReduction()
235 Instruction *ExitInstruction = nullptr; in AddReductionVar()
259 SmallPtrSet<Instruction *, 4> CastInsts; in AddReductionVar()
261 Instruction *Start = Phi; in AddReductionVar()
264 SmallPtrSet<Instruction *, 8> VisitedInsts; in AddReductionVar()
265 SmallVector<Instruction *, 8> Worklist; in AddReductionVar()
294 Instruction *ExactFPMathInst = nullptr; in AddReductionVar()
316 Instruction *Cur = Worklist.pop_back_val(); in AddReductionVar()
371 !VisitedInsts.count(dyn_cast<Instruction>(Cur->getOperand(0)))) in AddReductionVar()
436 SmallVector<Instruction *, 8> NonPHIs; in AddReductionVar()
437 SmallVector<Instruction *, 8> PHIs; in AddReductionVar()
439 Instruction *UI = cast<Instruction>(U); in AddReductionVar()
538 ExitInstruction = cast<Instruction>(IntermediateStore->getValueOperand()); in AddReductionVar()
633 Instruction *I, InstDesc &Prev) { in isSelectCmpPattern()
668 RecurrenceDescriptor::isMinMaxPattern(Instruction *I, RecurKind Kind, in isMinMaxPattern()
724 RecurrenceDescriptor::isConditionalRdxPattern(RecurKind Kind, Instruction *I) { in isConditionalRdxPattern()
742 Instruction *I1 = in isConditionalRdxPattern()
743 isa<PHINode>(*TrueVal) ? dyn_cast<Instruction>(FalseVal) in isConditionalRdxPattern()
744 : dyn_cast<Instruction>(TrueVal); in isConditionalRdxPattern()
762 Instruction *I, RecurKind Kind, in isRecurrenceInstr()
768 case Instruction::PHI: in isRecurrenceInstr()
770 case Instruction::Sub: in isRecurrenceInstr()
771 case Instruction::Add: in isRecurrenceInstr()
773 case Instruction::Mul: in isRecurrenceInstr()
775 case Instruction::And: in isRecurrenceInstr()
777 case Instruction::Or: in isRecurrenceInstr()
779 case Instruction::Xor: in isRecurrenceInstr()
781 case Instruction::FDiv: in isRecurrenceInstr()
782 case Instruction::FMul: in isRecurrenceInstr()
785 case Instruction::FSub: in isRecurrenceInstr()
786 case Instruction::FAdd: in isRecurrenceInstr()
789 case Instruction::Select: in isRecurrenceInstr()
793 case Instruction::FCmp: in isRecurrenceInstr()
794 case Instruction::ICmp: in isRecurrenceInstr()
795 case Instruction::Call: in isRecurrenceInstr()
812 Instruction *I, SmallPtrSetImpl<Instruction *> &Insts, in hasMultipleUsesOf()
816 if (Insts.count(dyn_cast<Instruction>(U))) in hasMultipleUsesOf()
926 MapVector<Instruction *, Instruction *> &SinkAfter, DominatorTree *DT) { in isFirstOrderRecurrence() argument
947 auto *Previous = dyn_cast<Instruction>(Phi->getIncomingValueForBlock(Latch)); in isFirstOrderRecurrence()
961 auto CompareByComesBefore = [](const Instruction *A, const Instruction *B) { in isFirstOrderRecurrence()
964 std::set<Instruction *, decltype(CompareByComesBefore)> InstrsToSink( in isFirstOrderRecurrence()
968 SmallVector<Instruction *, 8> WorkList; in isFirstOrderRecurrence()
969 auto TryToPushSinkCandidate = [&](Instruction *SinkCandidate) { in isFirstOrderRecurrence()
998 Instruction *EarlierInst = EarlierIt->second; in isFirstOrderRecurrence()
1034 Instruction *Current = WorkList.pop_back_val(); in isFirstOrderRecurrence()
1036 if (!TryToPushSinkCandidate(cast<Instruction>(User))) in isFirstOrderRecurrence()
1042 for (Instruction *I : InstrsToSink) { in isFirstOrderRecurrence()
1105 return Instruction::Add; in getOpcode()
1107 return Instruction::Mul; in getOpcode()
1109 return Instruction::Or; in getOpcode()
1111 return Instruction::And; in getOpcode()
1113 return Instruction::Xor; in getOpcode()
1115 return Instruction::FMul; in getOpcode()
1118 return Instruction::FAdd; in getOpcode()
1124 return Instruction::ICmp; in getOpcode()
1128 return Instruction::FCmp; in getOpcode()
1134 SmallVector<Instruction *, 4>
1136 SmallVector<Instruction *, 4> ReductionOperations; in getReductionOpChain()
1155 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) in getReductionOpChain()
1158 auto getNextInstruction = [&](Instruction *Cur) -> Instruction * { in getReductionOpChain()
1160 Instruction *UI = cast<Instruction>(User); in getReductionOpChain()
1163 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) { in getReductionOpChain()
1174 auto isCorrectOpcode = [&](Instruction *Cur) { in getReductionOpChain()
1175 if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) { in getReductionOpChain()
1189 Instruction *RdxInstr = LoopExitInstr; in getReductionOpChain()
1194 Instruction *Inc0 = dyn_cast<Instruction>(ExitPhi->getIncomingValue(0)); in getReductionOpChain()
1195 Instruction *Inc1 = dyn_cast<Instruction>(ExitPhi->getIncomingValue(1)); in getReductionOpChain()
1197 Instruction *Chain = nullptr; in getReductionOpChain()
1221 Instruction *Cur = getNextInstruction(Phi); in getReductionOpChain()
1240 SmallVectorImpl<Instruction *> *Casts) in InductionDescriptor()
1266 (InductionBinOp->getOpcode() == Instruction::FAdd || in InductionDescriptor()
1267 InductionBinOp->getOpcode() == Instruction::FSub))) && in InductionDescriptor()
1318 if (BOp->getOpcode() == Instruction::FAdd) { in isFPInductionPHI()
1323 } else if (BOp->getOpcode() == Instruction::FSub) in isFPInductionPHI()
1331 if (auto *I = dyn_cast<Instruction>(Addend)) in isFPInductionPHI()
1376 SmallVectorImpl<Instruction *> &CastInsts) { in getCastsForInductionPHI()
1419 auto *Inst = dyn_cast<Instruction>(Val); in getCastsForInductionPHI()
1440 Inst = dyn_cast<Instruction>(Val); in getCastsForInductionPHI()
1482 SmallVector<Instruction *, 2> Casts; in isInductionPHI()
1493 SmallVectorImpl<Instruction *> *CastsToIgnore) { in isInductionPHI()