29 for (
size_t i = 0; i < n; ++i) element =
mem::op_lea(element, tuple->proj(n, i));
61 assert(!
match<matrix::shape>(def) &&
"high level operations should have been lowered to for loops by now");
62 assert(!
match<matrix::prod>(def) &&
"high level operations should have been lowered to for loops by now");
64 assert(!
match<matrix::sum>(def) &&
"high level operations should have been lowered to for loops by now");
68 auto [_, S, T] = mat_ax->args<3>();
71 auto arr_ty = arr_ty_of_matrix_ty(S, T);
78 world().DLOG(
"init {} : {}", def, def->
type());
79 auto [_, S, T,
mem] = init_ax->args<4>();
80 world().DLOG(
" S T mem {} {} {}", S, T,
mem);
84 world().DLOG(
" S T mem {} {} {}", S, T,
mem);
85 auto arr_ty = arr_ty_of_matrix_ty(S, T);
88 world().DLOG(
" res {} : {}", res, res->type());
91 auto [
mem, mat, idx] = read_ax->args<3>();
92 world().DLOG(
"read_ax: {}", read_ax);
94 world().DLOG(
" mat: {} : {}", mat, mat->type());
95 world().DLOG(
" idx: {} : {}", idx, idx->type());
99 world().DLOG(
"rewritten read");
101 world().DLOG(
" mat: {} : {}", mat, mat->type());
102 world().DLOG(
" idx: {} : {}", idx, idx->type());
105 auto element_ptr = op_lea_tuple(ptr_mat, idx);
109 auto [
mem, mat, idx, val] = insert_ax->args<4>();
110 world().DLOG(
"insert_ax: {}", insert_ax);
112 world().DLOG(
" mat: {} : {}", mat, mat->type());
113 world().DLOG(
" idx: {} : {}", idx, idx->type());
114 world().DLOG(
" val: {} : {}", val, val->type());
119 world().DLOG(
"rewritten insert");
121 world().DLOG(
" mat: {} : {}", mat, mat->type());
122 world().DLOG(
" idx: {} : {}", idx, idx->type());
123 world().DLOG(
" val: {} : {}", val, val->type());
125 auto element_ptr = op_lea_tuple(ptr_mat, idx);
129 auto [
mem, val] = const_ax->args<2>();
132 auto [n_def, S, T] = const_ax->callee()->as<
App>()->args<3>();
135 auto arr_ty = arr_ty_of_matrix_ty(S, T);
139 auto n = n_def->as<
Lit>()->get<u64>();
140 auto initial = op_pack_tuple(n, S, val);
148 if (def->isa<
Axiom>())
return def;