Lines Matching full:trip
154 HInductionVarAnalysis::InductionInfo* trip =
157 *min_val = GetVal(info, trip, in_body, /* is_min */ true);
158 *max_val = SimplifyMax(GetVal(info, trip, in_body, /* is_min */ false));
159 *needs_finite_test = NeedsTripCount(info) && IsUnsafeTripCount(trip);
240 bool in_body = true; // no known trip count
278 bool InductionVarRange::IsBodyTripCount(HInductionVarAnalysis::InductionInfo* trip) const {
279 if (trip != nullptr) {
280 if (trip->induction_class == HInductionVarAnalysis::kInvariant) {
281 return trip->operation == HInductionVarAnalysis::kTripCountInBody ||
282 trip->operation == HInductionVarAnalysis::kTripCountInBodyUnsafe;
288 bool InductionVarRange::IsUnsafeTripCount(HInductionVarAnalysis::InductionInfo* trip) const {
289 if (trip != nullptr) {
290 if (trip->induction_class == HInductionVarAnalysis::kInvariant) {
291 return trip->operation == HInductionVarAnalysis::kTripCountInBodyUnsafe ||
292 trip->operation == HInductionVarAnalysis::kTripCountInLoopUnsafe;
299 HInductionVarAnalysis::InductionInfo* trip,
302 // Detect common situation where an offset inside the trip count cancels out during range
306 if (trip != nullptr) {
307 HInductionVarAnalysis::InductionInfo* trip_expr = trip->op_a;
312 // Test original trip's negative operand (trip_expr->op_b) against offset of induction.
314 // Analyze cancelled trip with just the positive operand (trip_expr->op_a).
316 trip->induction_class,
317 trip->operation,
319 trip->op_b,
321 trip->type);
322 return GetVal(&cancelled_trip, trip, in_body, is_min);
325 // Test original trip's positive operand (trip_expr->op_a) against offset of induction.
327 // Analyze cancelled trip with just the negative operand (trip_expr->op_b).
334 trip->type);
336 trip->induction_class, trip->operation, &neg, trip->op_b, nullptr, trip->type);
337 return SubValue(Value(0), GetVal(&cancelled_trip, trip, in_body, !is_min));
344 return AddValue(GetMul(info->op_a, trip, trip, in_body, is_min),
345 GetVal(info->op_b, trip, in_body, is_min));
349 HInductionVarAnalysis::InductionInfo* trip,
360 GetFetch(instruction->InputAt(1), trip, in_body, is_min));
362 return AddValue(GetFetch(instruction->InputAt(0), trip, in_body, is_min),
366 return GetFetch(instruction->InputAt(0)->InputAt(0), trip, in_body, is_min);
371 return GetFetch(instruction->InputAt(0), trip, in_body, is_min);
374 // Special case for finding minimum: minimum of trip-count in loop-body is 1.
375 if (trip != nullptr && in_body && instruction == trip->op_a->fetch) {
383 HInductionVarAnalysis::InductionInfo* trip,
392 return AddValue(GetVal(info->op_a, trip, in_body, is_min),
393 GetVal(info->op_b, trip, in_body, is_min));
395 return SubValue(GetVal(info->op_a, trip, in_body, is_min),
396 GetVal(info->op_b, trip, in_body, !is_min));
399 GetVal(info->op_b, trip, in_body, !is_min));
401 return GetMul(info->op_a, info->op_b, trip, in_body, is_min);
403 return GetDiv(info->op_a, info->op_b, trip, in_body, is_min);
405 return GetFetch(info->fetch, trip, in_body, is_min);
409 return GetVal(info->op_a, trip, in_body, is_min);
417 return SubValue(GetVal(info->op_a, trip, in_body, is_min), Value(1));
425 return CorrectForType(GetLinear(info, trip, in_body, is_min), info->type);
429 return MergeVal(GetVal(info->op_a, trip, in_body, is_min),
430 GetVal(info->op_b, trip, in_body, is_min), is_min);
438 HInductionVarAnalysis::InductionInfo* trip,
441 Value v1_min = GetVal(info1, trip, in_body, /* is_min */ true);
442 Value v1_max = GetVal(info1, trip, in_body, /* is_min */ false);
443 Value v2_min = GetVal(info2, trip, in_body, /* is_min */ true);
444 Value v2_max = GetVal(info2, trip, in_body, /* is_min */ false);
476 HInductionVarAnalysis::InductionInfo* trip,
479 Value v1_min = GetVal(info1, trip, in_body, /* is_min */ true);
480 Value v1_max = GetVal(info1, trip, in_body, /* is_min */ false);
481 Value v2_min = GetVal(info2, trip, in_body, /* is_min */ true);
482 Value v2_max = GetVal(info2, trip, in_body, /* is_min */ false);
599 HInductionVarAnalysis::InductionInfo* trip =
602 return AddValue(MulValue(Value(v.a_constant), GetVal(info, trip, in_body, is_min)), Value(v.b_constant));
625 HInductionVarAnalysis::InductionInfo* trip =
627 if (trip == nullptr) {
628 return false; // codegen relies on trip count
631 // trip-count and the loop maybe unsafe (because in such cases, the index could "overshoot"
632 // the computed range). A taken test is needed for any unknown trip-count, even if evaluation
633 // code does not use the trip-count explicitly (since there could be an implicit relation
635 *needs_finite_test = NeedsTripCount(info) && IsUnsafeTripCount(trip);
636 *needs_taken_test = IsBodyTripCount(trip);
640 return GenerateCode(trip->op_b, nullptr, graph, block, taken_test, in_body, /* is_min */ false);
643 trip->op_b, nullptr, nullptr, nullptr, nullptr, in_body, /* is_min */ false)) {
651 GenerateCode(info, trip, graph, block, lower, in_body, /* is_min */ true)) &&
653 GenerateCode(info, trip, graph, block, upper, in_body, /* is_min */ false);
657 HInductionVarAnalysis::InductionInfo* trip,
681 if (GenerateCode(info->op_a, trip, graph, block, &opa, in_body, is_min) &&
682 GenerateCode(info->op_b, trip, graph, block, &opb, in_body, is_min)) {
705 if (GenerateCode(info->op_a, trip, graph, block, &opa, in_body, is_min) &&
706 GenerateCode(info->op_b, trip, graph, block, &opb, in_body, !is_min)) {
714 if (GenerateCode(info->op_b, trip, graph, block, &opb, in_body, !is_min)) {
729 return GenerateCode(info->op_a, trip, graph, block, result, in_body, is_min);
740 if (GenerateCode(info->op_a, trip, graph, block, &opb, in_body, is_min)) {
761 if (GenerateCode(trip, trip, graph, block, &opa, in_body, is_min_a) &&
762 GenerateCode(info->op_b, trip, graph, block, &opb, in_body, is_min)) {
782 Value extreme = GetVal(info, trip, in_body, is_min);