Lines Matching refs:Instr
616 static bool processUDivOrURem(BinaryOperator *Instr, LazyValueInfo *LVI) {
617 assert(Instr->getOpcode() == Instruction::UDiv ||
618 Instr->getOpcode() == Instruction::URem);
619 if (Instr->getType()->isVectorTy())
622 // Find the smallest power of two bitwidth that's sufficient to hold Instr's
624 auto OrigWidth = Instr->getType()->getIntegerBitWidth();
626 for (Value *Operand : Instr->operands()) {
628 LVI->getConstantRange(Operand, Instr->getParent()));
639 IRBuilder<> B{Instr};
640 auto *TruncTy = Type::getIntNTy(Instr->getContext(), NewWidth);
641 auto *LHS = B.CreateTruncOrBitCast(Instr->getOperand(0), TruncTy,
642 Instr->getName() + ".lhs.trunc");
643 auto *RHS = B.CreateTruncOrBitCast(Instr->getOperand(1), TruncTy,
644 Instr->getName() + ".rhs.trunc");
645 auto *BO = B.CreateBinOp(Instr->getOpcode(), LHS, RHS, Instr->getName());
646 auto *Zext = B.CreateZExt(BO, Instr->getType(), Instr->getName() + ".zext");
649 BinOp->setIsExact(Instr->isExact());
651 Instr->replaceAllUsesWith(Zext);
652 Instr->eraseFromParent();