We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2d750f commit b582561Copy full SHA for b582561
src/Solve.cpp
@@ -394,7 +394,7 @@ class SolveExpression : public IRMutator {
394
if (a_uses_var && !b_uses_var) {
395
const int64_t *ib = as_const_int(b);
396
auto is_multiple_of_b = [&](const Expr &e) {
397
- if (ib) {
+ if (ib && op->type.is_scalar()) {
398
int64_t r = 0;
399
return reduce_expr_modulo(e, *ib, &r) && r == 0;
400
} else {
@@ -1478,6 +1478,9 @@ void solve_test() {
1478
check_solve(min(x + y, x - z), x + min(y, 0 - z));
1479
check_solve(max(x + y, x - z), x + max(y, 0 - z));
1480
1481
+ check_solve((5 * Broadcast::make(x, 4) + y) / 5,
1482
+ Broadcast::make(x, 4) + (Broadcast::make(y, 4) / 5));
1483
+
1484
debug(0) << "Solve test passed\n";
1485
}
1486
0 commit comments