Home | History | Annotate | Download | only in Utils

Lines Matching refs:Instruction

74 // insertFastDiv - Substitutes the div/rem instruction with code that checks the
75 // value of the operands and uses a shorter-faster div/rem instruction when
76 // possible and the longer-slower div/rem instruction otherwise.
77 static bool insertFastDiv(Instruction *I, IntegerType *BypassType,
81 // Get instruction operands
117 Value *ShortDivisorV = FastBuilder.CreateCast(Instruction::Trunc, Divisor,
119 Value *ShortDividendV = FastBuilder.CreateCast(Instruction::Trunc, Dividend,
127 Value *FastQuotientV = FastBuilder.CreateCast(Instruction::ZExt,
130 Value *FastRemainderV = FastBuilder.CreateCast(Instruction::ZExt,
178 static bool reuseOrInsertFastDiv(Instruction *I, IntegerType *BypassType,
181 // Get instruction operands
193 // Replace all uses of div instruction with quotient phi node
196 // Replace all uses of rem instruction with remainder phi node
213 Instruction* Next = &*BB->begin();
217 Instruction* I = Next;
220 // Get instruction details
222 bool UseDivOp = Opcode == Instruction::SDiv || Opcode == Instruction::UDiv;
223 bool UseRemOp = Opcode == Instruction::SRem || Opcode == Instruction::URem;
224 bool UseSignedOp = Opcode == Instruction::SDiv ||
225 Opcode == Instruction::SRem;
235 // Get bitwidth of div/rem instruction
244 // Get type for div/rem instruction with bypass bitwidth