Lines Matching refs:getOperand
25 assert(I.getOperand(1)->getType() == I.getOperand(0)->getType()); in commonShiftTransforms()
26 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonShiftTransforms()
94 if (MaskedValueIsZero(I->getOperand(0), in CanEvaluateShifted()
97 return CanEvaluateTruncated(I->getOperand(0), Ty); in CanEvaluateShifted()
114 return CanEvaluateShifted(I->getOperand(0), NumBits, isLeftShift, IC, I) && in CanEvaluateShifted()
115 CanEvaluateShifted(I->getOperand(1), NumBits, isLeftShift, IC, I); in CanEvaluateShifted()
119 CI = dyn_cast<ConstantInt>(I->getOperand(1)); in CanEvaluateShifted()
134 if (IC.MaskedValueIsZero(I->getOperand(0), in CanEvaluateShifted()
144 CI = dyn_cast<ConstantInt>(I->getOperand(1)); in CanEvaluateShifted()
159 if (IC.MaskedValueIsZero(I->getOperand(0), in CanEvaluateShifted()
213 0, GetShiftedValue(I->getOperand(0), NumBits, isLeftShift, IC, DL)); in GetShiftedValue()
215 1, GetShiftedValue(I->getOperand(1), NumBits, isLeftShift, IC, DL)); in GetShiftedValue()
223 ConstantInt *CI = cast<ConstantInt>(BO->getOperand(1)); in GetShiftedValue()
242 V = IC.Builder->CreateAnd(BO->getOperand(0), in GetShiftedValue()
264 ConstantInt *CI = cast<ConstantInt>(BO->getOperand(1)); in GetShiftedValue()
282 V = IC.Builder->CreateAnd(I->getOperand(0), in GetShiftedValue()
302 1, GetShiftedValue(I->getOperand(1), NumBits, isLeftShift, IC, DL)); in GetShiftedValue()
304 2, GetShiftedValue(I->getOperand(2), NumBits, isLeftShift, IC, DL)); in GetShiftedValue()
357 if (Constant *BOOp = dyn_cast<Constant>(BO->getOperand(1))) in FoldShiftByConstant()
358 return BinaryOperator::CreateMul(BO->getOperand(0), in FoldShiftByConstant()
371 Instruction *TrOp = dyn_cast<Instruction>(TI->getOperand(0)); in FoldShiftByConstant()
378 isa<ConstantInt>(TrOp->getOperand(1))) { in FoldShiftByConstant()
426 if (isLeftShift && Op0BO->getOperand(1)->hasOneUse() && in FoldShiftByConstant()
427 match(Op0BO->getOperand(1), m_Shr(m_Value(V1), in FoldShiftByConstant()
430 Builder->CreateShl(Op0BO->getOperand(0), Op1, Op0BO->getName()); in FoldShiftByConstant()
433 Op0BO->getOperand(1)->getName()); in FoldShiftByConstant()
444 Value *Op0BOOp1 = Op0BO->getOperand(1); in FoldShiftByConstant()
450 Builder->CreateShl(Op0BO->getOperand(0), Op1, in FoldShiftByConstant()
462 if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() && in FoldShiftByConstant()
463 match(Op0BO->getOperand(0), m_Shr(m_Value(V1), in FoldShiftByConstant()
466 Builder->CreateShl(Op0BO->getOperand(1), Op1, Op0BO->getName()); in FoldShiftByConstant()
469 Op0BO->getOperand(0)->getName()); in FoldShiftByConstant()
480 if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() && in FoldShiftByConstant()
481 match(Op0BO->getOperand(0), in FoldShiftByConstant()
485 Builder->CreateShl(Op0BO->getOperand(1), Op1, Op0BO->getName()); in FoldShiftByConstant()
500 if (ConstantInt *Op0C = dyn_cast<ConstantInt>(Op0BO->getOperand(1))) { in FoldShiftByConstant()
531 Builder->CreateBinOp(I.getOpcode(), Op0BO->getOperand(0), Op1); in FoldShiftByConstant()
546 if (ShiftOp && isa<ConstantInt>(ShiftOp->getOperand(1))) { in FoldShiftByConstant()
560 ConstantInt *ShiftAmt1C = cast<ConstantInt>(ShiftOp->getOperand(1)); in FoldShiftByConstant()
565 Value *X = ShiftOp->getOperand(0); in FoldShiftByConstant()
700 SimplifyShlInst(I.getOperand(0), I.getOperand(1), I.hasNoSignedWrap(), in visitShl()
707 if (ConstantInt *Op1C = dyn_cast<ConstantInt>(I.getOperand(1))) { in visitShl()
712 MaskedValueIsZero(I.getOperand(0), in visitShl()
721 ComputeNumSignBits(I.getOperand(0), 0, &I) > ShAmt) { in visitShl()
730 if (match(I.getOperand(0), m_OneUse(m_Shl(m_Constant(C1), m_Value(A)))) && in visitShl()
731 match(I.getOperand(1), m_Constant(C2))) in visitShl()
741 if (Value *V = SimplifyLShrInst(I.getOperand(0), I.getOperand(1), I.isExact(), in visitLShr()
748 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitLShr()
785 if (Value *V = SimplifyAShrInst(I.getOperand(0), I.getOperand(1), I.isExact(), in visitAShr()
792 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitAShr()
807 uint32_t SrcBits = ZI->getOperand(0)->getType()->getScalarSizeInBits(); in visitAShr()
810 return new SExtInst(ZI->getOperand(0), ZI->getType()); in visitAShr()