Lines Matching refs:Cur
305 Instruction *Cur = Worklist.pop_back_val(); in AddReductionVar() local
310 if (Cur->use_empty()) in AddReductionVar()
313 bool IsAPhi = isa<PHINode>(Cur); in AddReductionVar()
316 if (Cur != Phi && IsAPhi && Cur->getParent() == Phi->getParent()) in AddReductionVar()
321 if (!Cur->isCommutative() && !IsAPhi && !isa<SelectInst>(Cur) && in AddReductionVar()
322 !isa<ICmpInst>(Cur) && !isa<FCmpInst>(Cur) && in AddReductionVar()
323 !VisitedInsts.count(dyn_cast<Instruction>(Cur->getOperand(0)))) in AddReductionVar()
329 if (Cur != Start) { in AddReductionVar()
330 ReduxDesc = isRecurrenceInstr(Cur, Kind, ReduxDesc, FuncFMF); in AddReductionVar()
353 bool IsASelect = isa<SelectInst>(Cur); in AddReductionVar()
358 hasMultipleUsesOf(Cur, VisitedInsts, 2)) in AddReductionVar()
363 hasMultipleUsesOf(Cur, VisitedInsts, 1)) in AddReductionVar()
367 if (IsAPhi && Cur != Phi && !areAllUsesIn(Cur, VisitedInsts)) in AddReductionVar()
371 (isa<ICmpInst>(Cur) || isa<SelectInst>(Cur))) in AddReductionVar()
374 (isa<FCmpInst>(Cur) || isa<SelectInst>(Cur))) in AddReductionVar()
378 FoundReduxOp |= !IsAPhi && Cur != Start; in AddReductionVar()
385 for (User *U : Cur->users()) { in AddReductionVar()
393 if (ExitInstruction == Cur) in AddReductionVar()
400 if (ExitInstruction != nullptr || Cur == Phi) in AddReductionVar()
406 if (!is_contained(Phi->operands(), Cur)) in AddReductionVar()
409 ExitInstruction = Cur; in AddReductionVar()
918 auto getNextInstruction = [&](Instruction *Cur) { in getReductionOpChain() argument
922 if (isa<SelectInst>(*Cur->user_begin())) in getReductionOpChain()
923 return cast<Instruction>(*Cur->user_begin()); in getReductionOpChain()
925 return cast<Instruction>(*std::next(Cur->user_begin())); in getReductionOpChain()
927 return cast<Instruction>(*Cur->user_begin()); in getReductionOpChain()
929 auto isCorrectOpcode = [&](Instruction *Cur) { in getReductionOpChain() argument
933 matchSelectPattern(Cur, LHS, RHS).Flavor); in getReductionOpChain()
935 return Cur->getOpcode() == RedOp; in getReductionOpChain()
948 Instruction *Cur = getNextInstruction(Phi); in getReductionOpChain() local
952 while (Cur != LoopExitInstr) { in getReductionOpChain()
953 if (!isCorrectOpcode(Cur) || !Cur->hasNUses(ExpectedUses)) in getReductionOpChain()
956 ReductionOperations.push_back(Cur); in getReductionOpChain()
957 Cur = getNextInstruction(Cur); in getReductionOpChain()
960 ReductionOperations.push_back(Cur); in getReductionOpChain()