thorin2
thorin2 copied to clipboard
What should we do when allocating nominal arrays?
What should we do with sth like this?
«i: n; «i as Nat; T»»
See #165.
As note: An alternative (to #165) way how this issue manifests is during code generation (instead of application):
%core.trait.*
is expected to be resolved entirely before code generation.
In some cases, however, it remains and no size is computed.
Example: %core.trait.size «_3152207; «_3152209; .Idx 4294967296»»
.
Fork: Neuralcoder3
Branch: matrix_dialect
Call: ./build/bin/thorin -d matrix lit/matrix/print_const_dyn_mat.thorin -d affine -d direct -d clos -o - -VVVV --output-ll T.ll
Note: add_mem is disabled due to another bug (possibly related to projections)
The indices are statically unknown.
Note: Code generation fails with assert(false);
without telling that it happens during code generation or what is wrong.
A more informative error like assert(false && "trait should be lowered before codegen");
would be helpful.
We've already mentioned that in a couple of other issues like #9 that we probably want to move away from assertions and instead use proper error messages/exceptions instead. In the midterm we could expose this "failure is an option" to the compilation pipeline.