@@ -76,8 +76,8 @@ Expr reduce_expr_helper(Expr e, const Expr &modulus) {
7676}
7777
7878Expr reduce_expr (Expr e, const Expr &modulus, const Scope<Interval> &bounds) {
79- e = reduce_expr_helper (simplify (e, true , bounds), modulus);
80- if (is_const_one (simplify (e >= 0 && e < modulus, true , bounds))) {
79+ e = reduce_expr_helper (simplify (e, bounds), modulus);
80+ if (is_const_one (simplify (e >= 0 && e < modulus, bounds))) {
8181 return e;
8282 } else {
8383 return e % modulus;
@@ -285,7 +285,7 @@ class DetermineAllocStride : public IRVisitor {
285285
286286 // A version of can_prove which exploits the constant bounds we've been tracking
287287 bool can_prove (const Expr &e) {
288- return is_const_one (simplify (e, true , bounds));
288+ return is_const_one (simplify (e, bounds));
289289 }
290290
291291 Expr get_stride () {
@@ -411,7 +411,7 @@ class LowerWarpShuffles : public IRMutator {
411411 // the number of lanes (rounded up).
412412 Expr extent = op->extent ();
413413 Expr new_size = (alloc->extents [0 ] + extent - 1 ) / extent;
414- new_size = simplify (new_size, true , bounds);
414+ new_size = simplify (new_size, bounds);
415415 new_size = find_constant_bound (new_size, Direction::Upper, bounds);
416416 auto sz = as_const_int (new_size);
417417 user_assert (sz) << " Warp-level allocation with non-constant size: "
@@ -511,7 +511,7 @@ class LowerWarpShuffles : public IRMutator {
511511 // of the index and shifting the high bits down to cover
512512 // them. Reassembling the result into a flat address gives
513513 // the expression below.
514- Expr in_warp_idx = simplify ((idx / (warp_size * stride)) * stride + reduce_expr (idx, stride, bounds), true , bounds);
514+ Expr in_warp_idx = simplify ((idx / (warp_size * stride)) * stride + reduce_expr (idx, stride, bounds), bounds);
515515 return Store::make (op->name , value, in_warp_idx, op->param , op->predicate , ModulusRemainder ());
516516 } else {
517517 return IRMutator::visit (op);
@@ -536,7 +536,7 @@ class LowerWarpShuffles : public IRMutator {
536536 // Load the right lanes from stripe number i
537537 equiv = select (idx >= i, make_warp_load (type, name, make_const (idx.type (), i), lane), equiv);
538538 }
539- return simplify (equiv, true , bounds);
539+ return simplify (equiv, bounds);
540540 }
541541
542542 // Load the value to be shuffled
@@ -606,7 +606,7 @@ class LowerWarpShuffles : public IRMutator {
606606 } else if (expr_match ((this_lane + wild) % wild, lane, result) &&
607607 (bits = is_const_power_of_two_integer (result[1 ])) &&
608608 *bits <= 5 ) {
609- result[0 ] = simplify (result[0 ] % result[1 ], true , bounds);
609+ result[0 ] = simplify (result[0 ] % result[1 ], bounds);
610610 // Rotate. Mux a shuffle up and a shuffle down. Uses fewer
611611 // intermediate registers than using a general gather for
612612 // this.
@@ -617,7 +617,7 @@ class LowerWarpShuffles : public IRMutator {
617617 shfl_args ({membermask, base_val, (1 << *bits) - result[0 ], 0 }), Call::PureExtern);
618618 Expr cond = (this_lane >= (1 << *bits) - result[0 ]);
619619 Expr equiv = select (cond, up, down);
620- shuffled = simplify (equiv, true , bounds);
620+ shuffled = simplify (equiv, bounds);
621621 } else {
622622 // The format of the mask is a pain. The high bits tell
623623 // you how large the a warp is for this instruction
@@ -647,10 +647,10 @@ class LowerWarpShuffles : public IRMutator {
647647 Expr stride = alloc->stride ;
648648
649649 // Break the index into lane and stripe components
650- Expr lane = simplify (reduce_expr (idx / stride, warp_size, bounds), true , bounds);
651- idx = simplify ((idx / (warp_size * stride)) * stride + reduce_expr (idx, stride, bounds), true , bounds);
650+ Expr lane = simplify (reduce_expr (idx / stride, warp_size, bounds), bounds);
651+ idx = simplify ((idx / (warp_size * stride)) * stride + reduce_expr (idx, stride, bounds), bounds);
652652 // We don't want the idx to depend on the lane var, so try to eliminate it
653- idx = simplify (solve_expression (idx, this_lane_name).result , true , bounds);
653+ idx = simplify (solve_expression (idx, this_lane_name).result , bounds);
654654 return make_warp_load (op->type , op->name , idx, lane);
655655 } else {
656656 return IRMutator::visit (op);
0 commit comments