Home | History | Annotate | Download | only in CodeGen

Lines Matching defs:Ext

65 STATISTIC(NumExtsMoved,  "Number of [s|z]ext instructions combined with loads");
66 STATISTIC(NumExtUses, "Number of uses of [s|z]ext instructions optimized");
68 "Number of and mask instructions added to form ext loads");
105 "disable-cgp-ext-ld-promotion", cl::Hidden, cl::init(false),
106 cl::desc("Disable ext(promotable(ld)) -> promoted(ext(ld)) optimization in "
110 "stress-cgp-ext-ld-promotion", cl::Hidden, cl::init(false),
111 cl::desc("Stress test ext(promotable(ld)) -> promoted(ext(ld)) "
2714 /// ext (Ty Inst opnd1 opnd2 ... opndN) to ConsideredExtType.
2716 /// ConsideredExtType Inst (ext opnd1 to ConsideredExtType, ...).
2718 /// ext opnd1 to ConsideredExtType.
2729 /// \brief Utility function to promote the operand of \p Ext when this
2733 /// created to promote the operand of Ext.
2737 /// \return The promoted value which is used instead of Ext.
2739 Instruction *Ext, TypePromotionTransaction &TPT,
2744 /// \brief Utility function to promote the operand of \p Ext when this
2748 /// created to promote the operand of Ext.
2752 /// \return The promoted value which is used instead of Ext.
2753 static Value *promoteOperandForOther(Instruction *Ext,
2763 Instruction *Ext, TypePromotionTransaction &TPT,
2767 return promoteOperandForOther(Ext, TPT, PromotedInsts, CreatedInstsCost,
2773 Instruction *Ext, TypePromotionTransaction &TPT,
2777 return promoteOperandForOther(Ext, TPT, PromotedInsts, CreatedInstsCost,
2782 /// Type for the utility function that promotes the operand of Ext.
2783 typedef Value *(*Action)(Instruction *Ext, TypePromotionTransaction &TPT,
2789 /// \brief Given a sign/zero extend instruction \p Ext, return the approriate
2790 /// action to promote the operand of \p Ext instead of using Ext.
2798 static Action getAction(Instruction *Ext, const SetOfInstrs &InsertedInsts,
2830 // ext(trunc(opnd)) --> ext(opnd)
2868 Instruction *Ext, const SetOfInstrs &InsertedInsts,
2870 assert((isa<SExtInst>(Ext) || isa<ZExtInst>(Ext)) &&
2872 Instruction *ExtOpnd = dyn_cast<Instruction>(Ext->getOperand(0));
2873 Type *ExtTy = Ext->getType();
2874 bool IsSExt = isa<SExtInst>(Ext);
2941 // At this point we have: ext ty opnd to ty.
2949 Instruction *Ext, TypePromotionTransaction &TPT,
2954 // By construction, the operand of Ext is an instruction. Otherwise we cannot
2956 Instruction *ExtOpnd = cast<Instruction>(Ext->getOperand(0));
2960 // All its uses, but Ext, will need to use a truncated value of the
2963 Value *Trunc = TPT.createTrunc(Ext, ExtOpnd->getType());
2973 // Restore the operand of Ext (which has been replaced by the previous call
2975 TPT.setOperand(Ext, 0, ExtOpnd);
2980 // 2. Replace the uses of Ext by Inst.
2988 TPT.mutateType(ExtOpnd, Ext->getType());
2990 TPT.replaceAllUsesWith(Ext, ExtOpnd);
2992 Instruction *ExtForOpnd = Ext;
2994 DEBUG(dbgs() << "Propagate Ext to operands\n");
2998 if (ExtOpnd->getOperand(OpIdx)->getType() == Ext->getType() ||
3007 unsigned BitWidth = Ext->getType()->getIntegerBitWidth();
3010 TPT.setOperand(ExtOpnd, OpIdx, ConstantInt::get(Ext->getType(), CstVal));
3016 TPT.setOperand(ExtOpnd, OpIdx, UndefValue::get(Ext->getType()));
3021 // Check if Ext was reused to extend an operand.
3024 DEBUG(dbgs() << "More operands to ext\n");
3025 Value *ValForExtOpnd = IsSExt ? TPT.createSExt(Ext, Opnd, Ext->getType())
3026 : TPT.createZExt(Ext, Opnd, Ext->getType());
3044 if (ExtForOpnd == Ext) {
3046 TPT.eraseInstruction(Ext);
3261 Instruction *Ext = dyn_cast<Instruction>(AddrInst);
3262 if (!Ext)
3265 // Try to move this ext out of the way of the addressing mode.
3268 TypePromotionHelper::getAction(Ext, InsertedInsts, TLI, PromotedInsts);
3275 unsigned ExtCost = !TLI.isExtFree(Ext);
3277 TPH(Ext, TPT, PromotedInsts, CreatedInstsCost, nullptr, nullptr, TLI);
3283 // idx = ext op
3286 // promotedOpnd = ext opnd <- no match here
4040 /// If an ext(load) can be formed, it is returned via \p LI for the load
4046 /// \return true when promoting was necessary to expose the ext(load)
4066 // Iterate over all the extensions to see if one form an ext(load).
4068 // Check if we directly have ext(load).
4111 // Check if it exposes an ext(load).
4120 // If this does not help to expose an ext(load) then, rollback.
4123 // None of the extension can form an ext(load).
4178 assert(isa<SExtInst>(I) && "Unexpected ext type!");
4199 // If the result of a {s|z}ext and its source are both live out, rewrite all
4218 // Figure out which BB this ext is used in.
4245 // Figure out which BB this ext is used in.
4259 // Replace a use of the {s|z}ext source with a use of the result.
4655 // Figure out which BB this ext is used in.