expr = isl_ast_expr_from_aff(isl_aff_copy(aff), build);
c = isl_ast_expr_alloc_int(ctx, d);
- return isl_ast_expr_alloc_binary(isl_ast_op_pdiv_r, expr, c);
+ expr = isl_ast_expr_alloc_binary(isl_ast_op_pdiv_r, expr, c);
+
+ if (!isl_int_is_one(v)) {
+ c = isl_ast_expr_alloc_int(ctx, v);
+ expr = isl_ast_expr_mul(c, expr);
+ }
+
+ return expr;
}
/* Create an isl_ast_expr evaluating "v" times the specified dimension of "ls".
--- /dev/null
+# check that modulo constraint is generated correctly
+[n, m] -> { A[] -> [] : 2 * (n % 100) = 3 * (m % 200) }
+[n, m] -> { : m, n >= 0 }
+{}