Lines Matching refs:Value
79 Value *InstCombiner::EmitGEPOffset(User *GEP) {
121 static bool MaintainNoSignedWrap(BinaryOperator &I, Value *B, Value *C) {
207 Value *A = Op0->getOperand(0);
208 Value *B = Op0->getOperand(1);
209 Value *C = I.getOperand(1);
212 if (Value *V = SimplifyBinOp(Opcode, B, C, DL)) {
236 Value *A = I.getOperand(0);
237 Value *B = Op1->getOperand(0);
238 Value *C = Op1->getOperand(1);
241 if (Value *V = SimplifyBinOp(Opcode, A, B, DL)) {
258 Value *A = Op0->getOperand(0);
259 Value *B = Op0->getOperand(1);
260 Value *C = I.getOperand(1);
263 if (Value *V = SimplifyBinOp(Opcode, C, A, DL)) {
278 Value *A = I.getOperand(0);
279 Value *B = Op1->getOperand(0);
280 Value *C = Op1->getOperand(1);
283 if (Value *V = SimplifyBinOp(Opcode, C, A, DL)) {
303 Value *A = Op0->getOperand(0);
305 Value *B = Op1->getOperand(0);
404 /// This function returns identity value for given opcode, which can be used to
406 static Value *getIdentityValue(Instruction::BinaryOps OpCode, Value *V) {
426 BinaryOperator *Op, Value *&LHS, Value *&RHS) {
454 static Value *tryFactorization(InstCombiner::BuilderTy *Builder,
456 Instruction::BinaryOps InnerOpcode, Value *A,
457 Value *B, Value *C, Value *D) {
464 Value *V = nullptr;
465 Value *SimplifiedInst = nullptr;
466 Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
553 /// Returns the simplified value, or null if it didn't simplify.
554 Value *InstCombiner::SimplifyUsingDistributiveLaws(BinaryOperator &I) {
555 Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
560 Value *A = nullptr, *B = nullptr, *C = nullptr, *D = nullptr;
568 if (Value *V = tryFactorization(Builder, DL, I, LHSOpcode, A, B, C, D))
574 if (Value *V = tryFactorization(Builder, DL, I, LHSOpcode, A, B, RHS,
580 if (Value *V = tryFactorization(Builder, DL, I, RHSOpcode, LHS,
588 Value *A = Op0->getOperand(0), *B = Op0->getOperand(1), *C = RHS;
592 if (Value *L = SimplifyBinOp(TopLevelOpcode, A, C, DL))
593 if (Value *R = SimplifyBinOp(TopLevelOpcode, B, C, DL)) {
601 if (Value *V = SimplifyBinOp(InnerOpcode, L, R, DL))
613 Value *A = LHS, *B = Op1->getOperand(0), *C = Op1->getOperand(1);
617 if (Value *L = SimplifyBinOp(TopLevelOpcode, A, B, DL))
618 if (Value *R = SimplifyBinOp(TopLevelOpcode, A, C, DL)) {
626 if (Value *V = SimplifyBinOp(InnerOpcode, L, R, DL))
640 Value *SI = nullptr;
641 if (Value *V = SimplifyBinOp(TopLevelOpcode, SI0->getFalseValue(),
648 if (Value *V = SimplifyBinOp(TopLevelOpcode, SI0->getTrueValue(),
667 Value *InstCombiner::dyn_castNegVal(Value *V) const {
684 Value *InstCombiner::dyn_castFNegVal(Value *V, bool IgnoreZeroSign) const {
699 static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO,
715 Value *Op0 = SO, *Op1 = ConstOperand;
720 Value *RI = IC->Builder->CreateBinOp(BO->getOpcode(), Op0, Op1,
743 Value *TV = SI->getOperand(1);
744 Value *FV = SI->getOperand(2);
772 Value *Op0 = CI->getOperand(0), *Op1 = CI->getOperand(1);
779 Value *SelectTrueVal = FoldOperationIntoSelectOperand(Op, TV, this);
780 Value *SelectFalseVal = FoldOperationIntoSelectOperand(Op, FV, this);
811 // (constantint/constantfp/undef). If there is one non-constant value,
817 Value *InVal = PN->getIncomingValue(i);
822 if (NonConstBB) return nullptr; // More than one non-const value.
832 // If the incoming non-constant value is in I's block, we will remove one
839 // If there is exactly one non-constant value, we can insert a copy of the
862 Value *TrueV = SI->getTrueValue();
863 Value *FalseV = SI->getFalseValue();
867 Value *TrueVInPred = TrueV->DoPHITranslation(PhiTransBB, ThisBB);
868 Value *FalseVInPred = FalseV->DoPHITranslation(PhiTransBB, ThisBB);
869 Value *InV = nullptr;
883 Value *InV = nullptr;
897 Value *InV = nullptr;
909 Value *InV;
933 SmallVectorImpl<Value *> &NewIndices) {
1000 /// Return a value X such that Val = X * Scale, or null if none.
1002 Value *InstCombiner::Descale(Value *Val, APInt Scale, bool &NoSignedWrap) {
1005 Scale.getBitWidth() && "Scale not compatible with value!");
1035 // Replaced with its descaled value before exiting from the drill down loop.
1036 Value *Op = Val;
1076 Value *LHS = BO->getOperand(0);
1077 Value *RHS = BO->getOperand(1);
1112 Value *LHS = BO->getOperand(0);
1209 // multiplication, and Y is replaced by a value Z with smaller absolute value,
1211 // our way up, having NoSignedWrap 'true' means that the descaled value at the
1212 // current level has strictly smaller absolute value than the original.
1217 // value of the descaled multiplication, and we have to clear nsw flags
1227 // value than the original input doesn't tell us anything useful about
1246 static Value *CreateBinOpAsGiven(BinaryOperator &Inst, Value *LHS, Value *RHS,
1248 Value *BO = B->CreateBinOp(Inst.getOpcode(), LHS, RHS);
1259 Value *InstCombiner::SimplifyVectorOp(BinaryOperator &Inst) {
1269 Value
1284 Value *NewBO = CreateBinOpAsGiven(Inst, LShuf->getOperand(0),
1323 Value *NewLHS = isa<Constant>(LHS) ? C2 : Shuffle->getOperand(0);
1324 Value *NewRHS = isa<Constant>(LHS) ? Shuffle->getOperand(0) : C2;
1325 Value *NewBO = CreateBinOpAsGiven(Inst, NewLHS, NewRHS, Builder);
1335 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP.op_end());
1337 if (Value *V = SimplifyGEPInst(Ops, DL, TLI, DT, AC))
1340 Value *PtrOp = GEP.getOperand(0);
1389 // the value of the previous iteration needs to be stored in the meantime,
1502 SmallVector<Value*, 8> Indices;
1515 Value *Sum;
1516 Value *SO1 = Src->getOperand(Src->getNumOperands()-1);
1517 Value *GO1 = GEP.getOperand(1);
1574 Value *V = nullptr;
1595 Value *PtrToInt = Builder->CreatePtrToInt(PtrOp, Index->getType());
1596 Value *NewSub = Builder->CreateSub(PtrToInt, Index->getOperand(1));
1601 Value *Y;
1612 Value *StrippedPtr = PtrOp->stripPointerCasts();
1638 SmallVector<Value*, 8> Idx(GEP.idx_begin()+1, GEP.idx_end());
1676 SmallVector<Value*, 8> Idx(GEP.idx_begin(), GEP.idx_end());
1677 Value *NewGEP = GEP.isInBounds()
1696 Value *Idx[2] = { Constant::getNullValue(IdxType), GEP.getOperand(1) };
1697 Value *NewGEP =
1718 Value *Idx = GEP.getOperand(1);
1728 if (Value *NewIdx = Descale(Idx, APInt(BitWidth, Scale), NSW)) {
1732 Value *NewGEP =
1757 Value *Idx = GEP.getOperand(1);
1767 if (Value *NewIdx = Descale(Idx, APInt(BitWidth, Scale), NSW)) {
1771 Value *Off[2] = {
1775 Value *NewGEP = GEP.isInBounds() && NSW
1807 Value *Operand = BCI->getOperand(0);
1839 SmallVector<Value*, 8> NewIndices;
1841 Value *NGEP =
1992 Value *Op = FI.getArgOperand(0);
2034 Value *Op = FI.getArgOperand(0);
2066 Value *ResultOp = RI.getOperand(0);
2072 // determine the value. If so, constant fold it.
2084 Value *X = nullptr;
2105 FCmpInst::Predicate FPred; Value *Y;
2140 Value *Cond = SI.getCondition();
2167 Value *NewCond = Builder->CreateTrunc(SI.getCondition(), Ty, "trunc");
2203 Value *Agg = EV.getAggregateOperand();
2208 if (Value *V =
2246 Value *NewEV = Builder->CreateExtractValue(IV->getAggregateOperand(),
2254 // operate on the inserted value instead of the insertvalue result.
2266 // just get one value.
2275 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
2292 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
2301 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
2319 // extractvalue has integer indices, getelementptr has Value*s. Convert.
2320 SmallVector<Value*, 4> Indices;
2330 Value *GEP = Builder->CreateInBoundsGEP(L->getType(),
2339 // the value inserted, if appropriate. Similarly for extracts from single-use
2371 static bool shorter_filter(const Value *LHS, const Value *RHS) {
2391 SmallPtrSet<Value *, 16> AlreadyCaught; // Typeinfos known caught already.
2462 SmallPtrSet<Value *, 16> SeenInFilter; // For uniquing the elements.
2574 Value *Filter = NewClauses[i];
2583 Value *LFilter = NewClauses[j];
2639 Value *FTypeInfo = FArray->getOperand(f)->stripPointerCasts();
2642 Value *LTypeInfo = LArray->getOperand(l)->stripPointerCasts();
2711 // the end of block that could change the value.
2756 // value even when the operands are not all constants.
3052 // Lower dbg.declare intrinsics otherwise their value may be clobbered