Lines Matching defs:ToBePromoted
7630 /// Promote \p ToBePromoted by moving \p Def downward through.
7633 /// b = ToBePromoted <ty2> Def, ...
7635 /// b = ToBePromoted <ty1> a, ...
7636 /// Def = Transition <ty1> ToBePromoted to <ty2>
7637 void promoteImpl(Instruction *ToBePromoted);
7763 /// Check if we can promote \p ToBePromoted to \p Type.
7764 bool canPromote(const Instruction *ToBePromoted) const {
7766 return isa<BinaryOperator>(ToBePromoted);
7769 /// Check if it is profitable to promote \p ToBePromoted
7771 bool shouldPromote(const Instruction *ToBePromoted) const {
7774 for (const Use &U : ToBePromoted->operands()) {
7780 if (canCauseUndefinedBehavior(ToBePromoted, U.getOperandNo()))
7789 int ISDOpcode = TLI.InstructionOpcodeToISD(ToBePromoted->getOpcode());
7802 /// Record \p ToBePromoted as part of the chain to be promoted.
7803 void enqueueForPromotion(Instruction *ToBePromoted) {
7804 InstsToBePromoted.push_back(ToBePromoted);
7828 for (auto &ToBePromoted : InstsToBePromoted)
7829 promoteImpl(ToBePromoted);
7837 void VectorPromoteHelper::promoteImpl(Instruction *ToBePromoted) {
7838 // At this point, we know that all the operands of ToBePromoted but Def
7840 // For Def, we need to use its parameter in ToBePromoted:
7841 // b = ToBePromoted ty1 a
7846 assert(ToBePromoted->getType() == Transition->getType() &&
7849 ToBePromoted->replaceAllUsesWith(Transition);
7851 // b = ToBePromoted ty2 Def => b = ToBePromoted ty1 Def.
7853 ToBePromoted->mutateType(TransitionTy);
7856 // b = ToBePromoted ty1 Def => b = ToBePromoted ty1 a.
7857 for (Use &U : ToBePromoted->operands()) {
7868 canCauseUndefinedBehavior(ToBePromoted, U.getOperandNo()));
7872 ToBePromoted->setOperand(U.getOperandNo(), NewVal);
7874 Transition->moveAfter(ToBePromoted);
7875 Transition->setOperand(getTransitionOriginalValueIdx(), ToBePromoted);
7902 Instruction *ToBePromoted = cast<Instruction>(*Inst->user_begin());
7903 LLVM_DEBUG(dbgs() << "Use: " << *ToBePromoted << '\n');
7905 if (ToBePromoted->getParent() != Parent) {
7907 << ToBePromoted->getParent()->getName()
7913 if (VPH.canCombine(ToBePromoted)) {
7915 << "will be combined with: " << *ToBePromoted << '\n');
7916 VPH.recordCombineInstruction(ToBePromoted);
7923 if (!VPH.canPromote(ToBePromoted) || !VPH.shouldPromote(ToBePromoted))
7928 VPH.enqueueForPromotion(ToBePromoted);
7929 Inst = ToBePromoted;