9 Commits

Author SHA1 Message Date
Edward Chen
90f6b2ff35 Unsigned (#115)
Support `unsigned` in the C frontend
2022-11-01 23:46:08 -04:00
Edward Chen
f1dbab65ab Function Abstractions (#113)
Initial commit for support function abstractions.

`Computations` are maps of function names `str` to computation `Computation`. 

Updates:
- Frontend `Gen` returns `Computations` with only a single main `Computation`.
- Optimizations take in `Computations` instead of a single `Computation`. Optimizations are applied to each `Computation`. 
- Backends take in only the main `Computation`.
2022-10-18 21:27:58 -04:00
Edward Chen
a6bedd4f2d Boilerplate for C AstWalker (#109) 2022-10-18 10:14:03 -04:00
Edward Chen
e2edbadd0d Clone audit of the C frontend (#106) 2022-10-12 11:55:44 -07:00
Edward Chen
7693d30975 Updates to C Frontend (#67)
Supporting:
- structs
- ptrs
- n-dimension arrays
- nested structs
- typedef
- sizeof
- shift operations

Benchmarks:
- Original HyCC kmeans testcase (without recursion).
- Original HyCC gauss testcase.

Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
Co-authored-by: Ubuntu <ubuntu@neptune2.maas>
2022-05-20 02:20:36 -04:00
Alex Ozdemir
0b42f26089 Improve non-recursive type-checking (#74)
In *non-recursive* type-checking, perhaps better called *type computing*
we perform a minimal traversal in order to compute the type of a term,
without recursively type-checking it. Informally, we assume it is well
typed, and do the minimal amount of work needed to compute its type.

Two improvements:
1. No longer implemented with recursion.
2. Caches all intermediate results.

Implementation:
* `check_dependencies(Term) -> Vec<Term>`: maps a terms to the immediate
  children of it whose types are needed to compute its type.
* `check_raw_step(Term, TypeTable) -> Sort`: assumes those children have
  their types in the table, and computes this term's type.
* `check_raw`: glues the two above functions together into a suitable
  traversal. Similar to `rec_check_raw`, but the traversal isn't total.

Significance:

Previously, we had a non-recursive implementation for array stores that
*didn't cache intermediate results* which could cause quadratic
type-checking time (if the type-check callee was doing a top-down
traversal). Edward sent me a benchmark that was experiencing this,
resulting in 74.1% of total compilation time being spent type-checking.
Now it's down to 0.4% of total compilation time.
2022-04-11 11:41:02 -07:00
Edward Chen
8fed29bd32 ABY VM and Interpreter (#47)
Updated ABY testing framework with an ABY bytecode and interpreter
2022-02-28 19:47:50 -05:00
Edward Chen
76539bf05d Function and Import support for C Frontend (#45)
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
Co-authored-by: Ubuntu <ubuntu@neptune2.maas>
2022-02-16 12:15:51 -05:00
Edward Chen
75572c6a2c C Frontend (#22) 2022-01-20 10:16:27 -08:00