Lines Matching full:instruction
22 Instruction *InstCombiner::commonShiftTransforms(BinaryOperator &I) {
33 if (Instruction *R = FoldOpIntoSelect(I, SI))
37 if (Instruction *Res = FoldShiftByConstant(Op0, CUI, I))
74 Instruction *I = dyn_cast<Instruction>(V);
103 // require duplicating the instruction in general, which isn't profitable.
108 case Instruction::And:
109 case Instruction::Or:
110 case Instruction::Xor:
115 case Instruction::Shl: {
139 case Instruction::LShr: {
163 case Instruction::Select: {
168 case Instruction::PHI: {
198 Instruction *I = cast<Instruction>(V);
203 case Instruction::And:
204 case Instruction::Or:
205 case Instruction::Xor:
211 case Instruction::Shl: {
237 if (Instruction *VI = dyn_cast<Instruction>(V)) {
253 case Instruction::LShr: {
277 if (Instruction *VI = dyn_cast<Instruction>(V)) {
293 case Instruction::Select:
297 case Instruction::PHI: {
312 Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
314 bool isLeftShift = I.getOpcode() == Instruction::Shl;
319 if (I.getOpcode() != Instruction::AShr &&
329 // See if we can simplify any instructions used by the instruction whose sole
337 if (I.getOpcode() != Instruction::AShr)
346 if (BO->getOpcode() == Instruction::Mul && isLeftShift)
353 if (Instruction *R = FoldOpIntoSelect(I, SI))
356 if (Instruction *NV = FoldOpIntoPhi(I))
361 Instruction *TrOp = dyn_cast<Instruction>(TI->getOperand(0));
386 if (I.getOpcode() == Instruction::Shl)
389 assert(I.getOpcode() == Instruction::LShr && "Unknown logical shift");
410 case Instruction::Add:
411 Instruction::And:
412 case Instruction::Or:
413 case Instruction::Xor: {
446 case Instruction::Sub: {
488 case Instruction::Add:
491 case Instruction::Or:
492 case Instruction::Xor:
495 case Instruction::And:
506 if (isValid && I.getOpcode() == Instruction::AShr)
557 if (I.getOpcode() != Instruction::AShr)
568 if (I.getOpcode() == Instruction::LShr &&
569 ShiftOp->getOpcode() == Instruction::Shl) {
580 if (I.getOpcode() == Instruction::Shl &&
581 ShiftOp->getOpcode() != Instruction::Shl &&
583 assert(ShiftOp->getOpcode() == Instruction::LShr ||
584 ShiftOp->getOpcode() == Instruction::AShr);
586 BinaryOperator *NewShl = BinaryOperator::Create(Instruction::Shl,
594 if (I.getOpcode() == Instruction::LShr &&
595 ShiftOp->getOpcode() == Instruction::Shl) {
599 BinaryOperator *NewLShr = BinaryOperator::Create(Instruction::LShr,
613 if (I.getOpcode() == Instruction::AShr &&
614 ShiftOp->getOpcode() == Instruction::Shl) {
618 BinaryOperator *NewAShr = BinaryOperator::Create(Instruction::AShr,
631 if (I.getOpcode() == Instruction::Shl &&
632 ShiftOp->getOpcode() != Instruction::Shl &&
642 if (I.getOpcode() == Instruction::LShr &&
643 ShiftOp->getOpcode() == Instruction::Shl) {
647 BinaryOperator *NewShl = BinaryOperator::Create(Instruction::Shl,
661 if (I.getOpcode() == Instruction::AShr &&
662 ShiftOp->getOpcode() == Instruction::Shl) {
666 BinaryOperator *NewShl = BinaryOperator::Create(Instruction::Shl,
677 Instruction *InstCombiner::visitShl(BinaryOperator &I) {
683 if (Instruction *V = commonShiftTransforms(I))
715 Instruction *InstCombiner::visitLShr(BinaryOperator &I) {
720 if (Instruction *R = commonShiftTransforms(I))
755 Instruction *InstCombiner::visitAShr(BinaryOperator &I) {
760 if (Instruction *R = commonShiftTransforms(I))