• Home
  • Raw
  • Download

Lines Matching refs:Div

434 bool llvm::expandDivision(BinaryOperator *Div) {  in expandDivision()  argument
435 assert((Div->getOpcode() == Instruction::SDiv || in expandDivision()
436 Div->getOpcode() == Instruction::UDiv) && in expandDivision()
439 IRBuilder<> Builder(Div); in expandDivision()
441 assert(!Div->getType()->isVectorTy() && "Div over vectors not supported"); in expandDivision()
442 assert((Div->getType()->getIntegerBitWidth() == 32 || in expandDivision()
443 Div->getType()->getIntegerBitWidth() == 64) && in expandDivision()
447 if (Div->getOpcode() == Instruction::SDiv) { in expandDivision()
449 Value *Quotient = generateSignedDivisionCode(Div->getOperand(0), in expandDivision()
450 Div->getOperand(1), Builder); in expandDivision()
453 bool IsInsertPoint = Div->getIterator() == Builder.GetInsertPoint(); in expandDivision()
454 Div->replaceAllUsesWith(Quotient); in expandDivision()
455 Div->dropAllReferences(); in expandDivision()
456 Div->eraseFromParent(); in expandDivision()
465 Div = BO; in expandDivision()
469 Value *Quotient = generateUnsignedDivisionCode(Div->getOperand(0), in expandDivision()
470 Div->getOperand(1), in expandDivision()
472 Div->replaceAllUsesWith(Quotient); in expandDivision()
473 Div->dropAllReferences(); in expandDivision()
474 Div->eraseFromParent(); in expandDivision()
584 bool llvm::expandDivisionUpTo32Bits(BinaryOperator *Div) { in expandDivisionUpTo32Bits() argument
585 assert((Div->getOpcode() == Instruction::SDiv || in expandDivisionUpTo32Bits()
586 Div->getOpcode() == Instruction::UDiv) && in expandDivisionUpTo32Bits()
589 Type *DivTy = Div->getType(); in expandDivisionUpTo32Bits()
597 return expandDivision(Div); in expandDivisionUpTo32Bits()
601 IRBuilder<> Builder(Div); in expandDivisionUpTo32Bits()
609 if (Div->getOpcode() == Instruction::SDiv) { in expandDivisionUpTo32Bits()
610 ExtDividend = Builder.CreateSExt(Div->getOperand(0), Int32Ty); in expandDivisionUpTo32Bits()
611 ExtDivisor = Builder.CreateSExt(Div->getOperand(1), Int32Ty); in expandDivisionUpTo32Bits()
614 ExtDividend = Builder.CreateZExt(Div->getOperand(0), Int32Ty); in expandDivisionUpTo32Bits()
615 ExtDivisor = Builder.CreateZExt(Div->getOperand(1), Int32Ty); in expandDivisionUpTo32Bits()
620 Div->replaceAllUsesWith(Trunc); in expandDivisionUpTo32Bits()
621 Div->dropAllReferences(); in expandDivisionUpTo32Bits()
622 Div->eraseFromParent(); in expandDivisionUpTo32Bits()
632 bool llvm::expandDivisionUpTo64Bits(BinaryOperator *Div) { in expandDivisionUpTo64Bits() argument
633 assert((Div->getOpcode() == Instruction::SDiv || in expandDivisionUpTo64Bits()
634 Div->getOpcode() == Instruction::UDiv) && in expandDivisionUpTo64Bits()
637 Type *DivTy = Div->getType(); in expandDivisionUpTo64Bits()
646 return expandDivision(Div); in expandDivisionUpTo64Bits()
650 IRBuilder<> Builder(Div); in expandDivisionUpTo64Bits()
658 if (Div->getOpcode() == Instruction::SDiv) { in expandDivisionUpTo64Bits()
659 ExtDividend = Builder.CreateSExt(Div->getOperand(0), Int64Ty); in expandDivisionUpTo64Bits()
660 ExtDivisor = Builder.CreateSExt(Div->getOperand(1), Int64Ty); in expandDivisionUpTo64Bits()
663 ExtDividend = Builder.CreateZExt(Div->getOperand(0), Int64Ty); in expandDivisionUpTo64Bits()
664 ExtDivisor = Builder.CreateZExt(Div->getOperand(1), Int64Ty); in expandDivisionUpTo64Bits()
669 Div->replaceAllUsesWith(Trunc); in expandDivisionUpTo64Bits()
670 Div->dropAllReferences(); in expandDivisionUpTo64Bits()
671 Div->eraseFromParent(); in expandDivisionUpTo64Bits()