Lines Matching refs:Value
25 /// The specific integer value is used in a context where it is known to be
28 static Value *simplifyValueKnownNonZero(Value *V, InstCombiner &IC,
39 Value *A = nullptr, *B = nullptr, *One = nullptr;
55 if (Value *V2 = simplifyValueKnownNonZero(I->getOperand(0), IC, CxtI)) {
135 bool InstCombiner::WillNotOverflowSignedMul(Value *LHS, Value *RHS,
177 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
179 if (Value *V = SimplifyVectorOp(I))
182 if (Value *V = SimplifyMulInst(Op0, Op1, DL, TLI, DT, AC))
185 if (Value *V = SimplifyUsingDistributiveLaws(I))
198 Value *NewOp;
251 Value *X = nullptr, *Y = nullptr;
254 Value *Sub = nullptr;
281 Value *X;
284 Value *Mul = Builder->CreateMul(C1, Op1);
293 if (Value *Op0v = dyn_castNegVal(Op0)) { // -X * -Y = X*Y
294 if (Value *Op1v = dyn_castNegVal(Op1)) {
307 Value *Op1C = Op1;
315 Value *Neg = dyn_castNegVal(Op1C);
320 Value *Op0BO = BO->getOperand(0), *Op1BO = BO->getOperand(1);
330 Value *Rem;
350 Value *Y;
369 // If one of the operands of the multiply is a cast from a boolean value, then
376 Value *BoolCast = nullptr, *OtherOp = nullptr;
383 Value *V = Builder->CreateSub(Constant::getNullValue(I.getType()),
405 static void detectLog2OfHalf(Value *&Op, Value *&Y, IntrinsicInst *&Log2) {
416 Value *OpLog2Of = II->getArgOperand(0);
462 /// true iff the given value is FMul or FDiv with one and only one operand
464 static bool isFMulOrFDivWithConstant(Value *V) {
486 Value *InstCombiner::foldFMulConst(Instruction *FMulOrDiv, Constant *C,
490 Value *Opnd0 = FMulOrDiv->getOperand(0);
491 Value *Opnd1 = FMulOrDiv->getOperand(1);
536 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
538 if (Value *V = SimplifyVectorOp(I))
544 if (Value *V =
576 if (Value *V = foldFMulConst(cast<Instruction>(Op0), C, &I))
584 Value *Opnd0 = FAddSub->getOperand(0);
585 Value *Opnd1 = FAddSub->getOperand(1);
596 Value *M1 = ConstantExpr::getFMul(C1, C);
597 Value *M0 = isNormalFp(cast<Constant>(M1)) ?
624 Value *OpX = nullptr;
625 Value *OpY = nullptr;
641 Value *FMulVal = Builder->CreateFMul(OpX, Log2);
642 Value *FSub = Builder->CreateFSub(FMulVal, OpX);
649 Value *Opnd0 = Op0;
650 Value *Opnd1 = Op1;
657 Value *N0 = dyn_castFNegVal(Opnd0, IgnoreZeroSign);
658 Value *N1 = dyn_castFNegVal(Opnd1, IgnoreZeroSign);
662 Value *FMul = Builder->CreateFMul(N0, N1);
669 Value *T = Builder->CreateFMul(N0, Opnd1);
670 Value *Neg = Builder->CreateFNeg(T);
685 Value *Opnd0_0, *Opnd0_1;
688 Value *Y = nullptr;
697 Value *T = Builder->CreateFMul(Opnd1, Opnd1);
699 Value *R = Builder->CreateFMul(T, Y);
732 Value *SelectCond = SI->getOperand(0);
740 // propagate the known value for the select into other uses of it, and
741 // propagate a known value of the condition into its other users.
790 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
793 if (Value *V = simplifyValueKnownNonZero(I.getOperand(1), *this, I)) {
806 Value *X;
890 Value *Inc = Builder->CreateAdd(Op1, One);
891 Value *Cmp = Builder->CreateICmpULT(
907 Value *X = nullptr, *Z = nullptr;
920 static Value *dyn_castZExtVal(Value *V, Type *Ty) {
933 typedef Instruction *(*FoldUDivOperandCb)(Value *Op0, Value *Op1,
943 Value *OperandToFold; ///< Which operand to fold.
952 UDivFoldAction(FoldUDivOperandCb FA, Value *InputOperand)
954 UDivFoldAction(FoldUDivOperandCb FA, Value *InputOperand, size_t SLHS)
960 static Instruction *foldUDivPow2Cst(Value *Op0, Value *Op1,
971 static Instruction *foldUDivNegCst(Value *Op0, Value *Op1,
973 Value *ICI = IC.Builder->CreateICmpULT(Op0, cast<ConstantInt>(Op1));
980 static Instruction *foldUDivShl(Value *Op0, Value *Op1, const BinaryOperator &I,
988 Value *N = ShiftLeft->getOperand(1);
1003 static size_t visitUDivOperand(Value *Op0, Value *Op1, const BinaryOperator &I,
1043 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1045 if (Value *V = SimplifyVectorOp(I))
1048 if (Value *V = SimplifyUDivInst(Op0, Op1, DL, TLI, DT, AC))
1057 Value *X;
1076 if (Value *ZOp1 = dyn_castZExtVal(Op1, ZOp0->getSrcTy()))
1086 Value *ActionOp1 = UDivActions[i].OperandToFold;
1095 Value *SelectRHS = UDivActions[SelectRHSIdx].FoldResult;
1097 Value *SelectLHS = UDivActions[SelectLHSIdx].FoldResult;
1116 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1118 if (Value *V = SimplifyVectorOp(I))
1121 if (Value *V = SimplifySDivInst(Op0, Op1, DL, TLI, DT, AC))
1136 Value *ShAmt = llvm::ConstantInt::get(RHS->getType(),
1148 Value *X;
1170 // Safe because the only negative value (1 << Y) can take on is
1184 /// FP value and:
1190 static Instruction *CvtFDivConstToReciprocal(Value *Dividend, Constant *Divisor,
1214 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1216 if (Value *V = SimplifyVectorOp(I))
1219 if (Value *V = SimplifyFDivInst(Op0, Op1, I.getFastMathFlags(),
1239 Value *X;
1277 Value *X;
1302 Value *X, *Y;
1303 Value *NewInst = nullptr;
1348 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1351 if (Value *V = simplifyValueKnownNonZero(I.getOperand(1), *this, I)) {
1380 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1382 if (Value *V = SimplifyVectorOp(I))
1385 if (Value *V = SimplifyURemInst(Op0, Op1, DL, TLI, DT, AC))
1393 if (Value *ZOp1 = dyn_castZExtVal(Op1, ZOp0->getSrcTy()))
1400 Value *Add = Builder->CreateAdd(Op1, N1);
1406 Value
1407 Value *Ext = Builder->CreateZExt(Cmp, I.getType());
1415 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1417 if (Value *V = SimplifyVectorOp(I))
1420 if (Value *V = SimplifySRemInst(Op0, Op1, DL, TLI, DT, AC))
1490 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
1492 if (Value *V = SimplifyVectorOp(I))
1495 if (Value *V = SimplifyFRemInst(Op0, Op1, I.getFastMathFlags(),