Lines Matching refs:v2
104 static bool IsSameConstantValue(InductionVarRange::Value v1, InductionVarRange::Value v2) { in IsSameConstantValue() argument
105 return IsConstantValue(v1) && IsConstantValue(v2) && v1.b_constant == v2.b_constant; in IsSameConstantValue()
520 InductionVarRange::Value InductionVarRange::AddValue(Value v1, Value v2) const { in AddValue()
521 if (v1.is_known && v2.is_known && IsSafeAdd(v1.b_constant, v2.b_constant)) { in AddValue()
522 const int32_t b = v1.b_constant + v2.b_constant; in AddValue()
524 return Value(v2.instruction, v2.a_constant, b); in AddValue()
525 } else if (v2.a_constant == 0) { in AddValue()
527 } else if (v1.instruction == v2.instruction && IsSafeAdd(v1.a_constant, v2.a_constant)) { in AddValue()
528 return Value(v1.instruction, v1.a_constant + v2.a_constant, b); in AddValue()
534 InductionVarRange::Value InductionVarRange::SubValue(Value v1, Value v2) const { in SubValue()
535 if (v1.is_known && v2.is_known && IsSafeSub(v1.b_constant, v2.b_constant)) { in SubValue()
536 const int32_t b = v1.b_constant - v2.b_constant; in SubValue()
537 if (v1.a_constant == 0 && IsSafeSub(0, v2.a_constant)) { in SubValue()
538 return Value(v2.instruction, -v2.a_constant, b); in SubValue()
539 } else if (v2.a_constant == 0) { in SubValue()
541 } else if (v1.instruction == v2.instruction && IsSafeSub(v1.a_constant, v2.a_constant)) { in SubValue()
542 return Value(v1.instruction, v1.a_constant - v2.a_constant, b); in SubValue()
548 InductionVarRange::Value InductionVarRange::MulValue(Value v1, Value v2) const { in MulValue()
549 if (v1.is_known && v2.is_known) { in MulValue()
551 if (IsSafeMul(v1.b_constant, v2.a_constant) && IsSafeMul(v1.b_constant, v2.b_constant)) { in MulValue()
552 return Value(v2.instruction, v1.b_constant * v2.a_constant, v1.b_constant * v2.b_constant); in MulValue()
554 } else if (v2.a_constant == 0) { in MulValue()
555 if (IsSafeMul(v1.a_constant, v2.b_constant) && IsSafeMul(v1.b_constant, v2.b_constant)) { in MulValue()
556 return Value(v1.instruction, v1.a_constant * v2.b_constant, v1.b_constant * v2.b_constant); in MulValue()
563 InductionVarRange::Value InductionVarRange::DivValue(Value v1, Value v2) const { in DivValue()
564 if (v1.is_known && v2.is_known && v1.a_constant == 0 && v2.a_constant == 0) { in DivValue()
565 if (IsSafeDiv(v1.b_constant, v2.b_constant)) { in DivValue()
566 return Value(v1.b_constant / v2.b_constant); in DivValue()
572 InductionVarRange::Value InductionVarRange::MergeVal(Value v1, Value v2, bool is_min) const { in MergeVal() argument
573 if (v1.is_known && v2.is_known) { in MergeVal()
574 if (v1.instruction == v2.instruction && v1.a_constant == v2.a_constant) { in MergeVal()
576 is_min ? std::min(v1.b_constant, v2.b_constant) in MergeVal()
577 : std::max(v1.b_constant, v2.b_constant)); in MergeVal()