Home | History | Annotate | Download | only in Utils

Lines Matching refs:Instruction

36 bool RecurrenceDescriptor::areAllUsesIn(Instruction *I,
37 SmallPtrSetImpl<Instruction *> &Set) {
39 if (!Set.count(dyn_cast<Instruction>(*Use)))
76 Instruction *
78 SmallPtrSetImpl<Instruction *> &Visited,
79 SmallPtrSetImpl<Instruction *> &CI) {
84 Instruction *I, *J = cast<Instruction>(Phi->use_begin()->getUser());
102 Instruction *Start, Instruction *Exit, Type *RT, bool &IsSigned,
103 SmallPtrSetImpl<Instruction *> &Visited,
104 SmallPtrSetImpl<Instruction *> &CI) {
106 SmallVector<Instruction *, 8> Worklist;
114 Instruction *I = Worklist.pop_back_val();
117 // Terminate the traversal if the operand is not an instruction, or we
119 Instruction *J = dyn_cast<Instruction>(U.get());
131 // zero-extend instruction.
180 Instruction *ExitInstruction = nullptr;
185 // instruction. All users must be instructions that can be used as reduction
191 // the number of instruction we saw from the recognized min/max pattern,
198 SmallPtrSet<Instruction *, 4> CastInsts;
199 Instruction *Start = Phi;
202 SmallPtrSet<Instruction *, 8> VisitedInsts;
203 SmallVector<Instruction *, 8> Worklist;
231 // - By one instruction outside of the loop (safe).
233 // - By an instruction that is not part of the reduction (not safe).
235 // * An instruction type other than PHI or the reduction operation.
238 Instruction *Cur = Worklist.back();
242 // If the instruction has no users then this is a broken chain and can't be
257 !VisitedInsts.count(dyn_cast<Instruction>(Cur->getOperand(0))))
260 // Any reduction instruction must be of one of the allowed kinds. We ignore
261 // the starting value (the Phi or an AND instruction if the Phi has been
287 // Process users of current instruction. Push non-PHI nodes after PHI nodes
290 SmallVector<Instruction *, 8> NonPHIs;
291 SmallVector<Instruction *, 8> PHIs;
293 Instruction *UI = cast<Instruction>(U);
305 // The instruction used by an outside user must be the last instruction
338 // This means we have seen one but not the other instruction of the
356 // only have a single instruction with out-of-loop users.
358 // The ExitInstruction(Instruction which is allowed to have out-of-loop users)
370 /// Returns true if the instruction is a Select(ICmp(X, Y), X, Y) instruction
373 RecurrenceDescriptor::isMinMaxSelectCmpPattern(Instruction *I, InstDesc &Prev) {
376 "Expect a select instruction");
377 Instruction *Cmp = nullptr;
380 // We must handle the select(cmp()) as a single instruction. Advance to the
422 RecurrenceDescriptor::isRecurrenceInstr(Instruction *I, RecurrenceKind Kind,
425 Instruction *UAI = Prev.getUnsafeAlgebraInst();
427 UAI = I; // Found an unsafe (unvectorizable) algebra instruction.
432 case Instruction::PHI:
434 case Instruction::Sub:
435 case Instruction::Add:
437 case Instruction::Mul:
439 case Instruction::And:
441 case Instruction::Or:
443 case Instruction::Xor:
445 case Instruction::FMul:
447 case Instruction::FSub:
448 case Instruction::FAdd:
450 case Instruction::FCmp:
451 case Instruction::ICmp:
452 case Instruction::Select:
461 Instruction *I, SmallPtrSetImpl<Instruction *> &Insts) {
465 if (Insts.count(dyn_cast<Instruction>(*Use)))
544 auto *Previous = dyn_cast<Instruction>(Phi->getIncomingValueForBlock(Latch));
552 if (auto *I = dyn_cast<Instruction>(U))
590 return Instruction::Add;
592 return Instruction::Mul;
594 return Instruction::Or;
596 return Instruction::And;
598 return Instruction::Xor;
600 return Instruction::FMul;
602 return Instruction::FAdd;
604 return Instruction::ICmp;
606 return Instruction::FCmp;
819 SmallVector<Instruction *, 8> llvm::findDefsUsedOutsideOfLoop(Loop *L) {
820 SmallVector<Instruction *, 8> UsedOutside;
828 auto *Use = cast<Instruction>(U);
929 /// Returns true if the instruction in a loop is guaranteed to execute at least
931 bool llvm::isGuaranteedToExecute(const Instruction &Inst,
934 // We have to check to make sure that the instruction dominates all
936 // which does not execute this instruction, so we can't hoist it.
938 // If the instruction is in the header block for the loop (which is very
946 // Somewhere in this loop there is an instruction which may throw and make us