Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved backend support #182

Draft
wants to merge 245 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
60070f4
add lit test
christopherhjung Sep 28, 2022
d9199a9
save
christopherhjung Sep 29, 2022
7d07813
start of eta problem solution
NeuralCoder3 Oct 5, 2022
0338d45
ideas for type transformation
NeuralCoder3 Oct 5, 2022
970c2c9
inner autodiff type fix
NeuralCoder3 Oct 6, 2022
4869d56
fixed eta problem
NeuralCoder3 Oct 6, 2022
58b9519
one step towards fixing the infinite loop
NeuralCoder3 Oct 6, 2022
d1568c4
investigation of endless loop
NeuralCoder3 Oct 6, 2022
a330129
start of real tests
NeuralCoder3 Oct 7, 2022
d4ebad4
64 bit width is working
NeuralCoder3 Oct 7, 2022
e903622
save
christopherhjung Oct 9, 2022
75b96b2
Merge remote-tracking branch 'origin/autodiff' into autodiff
christopherhjung Oct 9, 2022
91c15e7
save
christopherhjung Oct 10, 2022
4fd9d09
real ad test
NeuralCoder3 Oct 10, 2022
67192e3
reordered dialects
NeuralCoder3 Oct 10, 2022
f67665b
made filter explicit
NeuralCoder3 Oct 10, 2022
087340f
enzyme test overview
NeuralCoder3 Oct 11, 2022
ed023e7
extracted relevant code
NeuralCoder3 Oct 11, 2022
70850ad
simple brussel test
NeuralCoder3 Oct 12, 2022
ccaf515
initialization
NeuralCoder3 Oct 12, 2022
bf0a218
time meassurement
NeuralCoder3 Oct 12, 2022
372973f
added brusselator functions
NeuralCoder3 Oct 12, 2022
f6ae248
fixed dominance
NeuralCoder3 Oct 12, 2022
5c528c8
more debugging on problem
NeuralCoder3 Oct 12, 2022
abe63c5
more attempts
NeuralCoder3 Oct 12, 2022
4231c0b
tried filters
NeuralCoder3 Oct 13, 2022
affc4e8
Merge branch 'master' into autodiff
NeuralCoder3 Oct 13, 2022
2903c96
localized problem even more
NeuralCoder3 Oct 13, 2022
5e0071b
working state without lamspec
NeuralCoder3 Oct 13, 2022
4849db5
earliest failure point
NeuralCoder3 Oct 13, 2022
c4326c6
bug in thorin
NeuralCoder3 Oct 13, 2022
cdd9f65
stuck at error in line 170
NeuralCoder3 Oct 13, 2022
1deea17
Merge branch 'eta-problem' into autodiff
NeuralCoder3 Oct 13, 2022
55fd344
Merge branch 'ad_real' into autodiff
NeuralCoder3 Oct 13, 2022
661e329
fixed merge/vscode issue
NeuralCoder3 Oct 13, 2022
670270a
new tests with pow deriv
NeuralCoder3 Oct 13, 2022
9a73cc7
refactor
NeuralCoder3 Oct 13, 2022
571a012
adapted tests to filter printing
NeuralCoder3 Oct 14, 2022
bdd9876
disabled LamSpec
NeuralCoder3 Oct 14, 2022
503565b
Merge branch 'master' into autodiff
NeuralCoder3 Oct 14, 2022
cf1c313
moved issues to closure
NeuralCoder3 Oct 14, 2022
84af1a0
removed debug print
NeuralCoder3 Oct 14, 2022
2baff33
Comparison to other functional languages
NeuralCoder3 Oct 17, 2022
53fd9f2
implement higher order scalerize
christopherhjung Oct 17, 2022
c0fd971
grouped evaluation, added thorin timing
NeuralCoder3 Oct 18, 2022
819bf8e
added timing
NeuralCoder3 Oct 18, 2022
392607d
alloca timing
NeuralCoder3 Oct 18, 2022
c78306b
commented out alloca run
NeuralCoder3 Oct 18, 2022
7e2d588
complete alloca
NeuralCoder3 Oct 18, 2022
a99aa96
implement autodiff arr and ptr support
christopherhjung Oct 20, 2022
a35f56c
refactoring
christopherhjung Oct 20, 2022
8566c36
more refactoring
christopherhjung Oct 20, 2022
a0d328c
haskell fully cps
NeuralCoder3 Oct 21, 2022
56274a6
polymorphic
NeuralCoder3 Oct 21, 2022
eaf5c6e
large program tests
NeuralCoder3 Oct 21, 2022
b1772d4
map issue
NeuralCoder3 Oct 21, 2022
e760116
avoid OS dependent ignores
NeuralCoder3 Oct 21, 2022
2054750
removed editor dependent files
NeuralCoder3 Oct 21, 2022
536f8e7
removed temporary files
NeuralCoder3 Oct 21, 2022
ea68622
started to improve comment style
NeuralCoder3 Oct 21, 2022
639b8fd
Merge branch 'master' into autodiff
NeuralCoder3 Oct 21, 2022
e7c681e
fix missing builder
christopherhjung Oct 21, 2022
aff8b00
add DS_Store to gitignore
christopherhjung Oct 21, 2022
d4a4e34
remove DS_Store
christopherhjung Oct 21, 2022
c2b7874
repeat commit e760116
NeuralCoder3 Oct 22, 2022
1c0b82b
Merge branch 'autodiff' into autodiff_ptr (only technically, inspecti…
NeuralCoder3 Oct 24, 2022
ec371b7
Merge branch 'master' into autodiff
NeuralCoder3 Oct 25, 2022
be13f84
top_level flat arguments
NeuralCoder3 Oct 25, 2022
1f9c5f3
reorder memory
NeuralCoder3 Oct 25, 2022
e05a86e
fixed thorin printer errors
NeuralCoder3 Oct 25, 2022
010e724
fixed compilation preventing bugs
NeuralCoder3 Oct 25, 2022
be06774
update
NeuralCoder3 Oct 25, 2022
e1c1f28
Merge branch 'autodiff' into ad_ptr_merge
NeuralCoder3 Oct 25, 2022
e3d0f71
clang format
NeuralCoder3 Oct 25, 2022
15a153e
clang format
NeuralCoder3 Oct 25, 2022
eb6cc63
readded unicodes
NeuralCoder3 Oct 25, 2022
21b58f3
filter print
NeuralCoder3 Oct 25, 2022
4cff7dd
removed unused declaration
NeuralCoder3 Oct 25, 2022
88acd2b
removed superfluous code from tests
NeuralCoder3 Oct 25, 2022
ecdfe71
also for simple_mem
NeuralCoder3 Oct 25, 2022
0719560
corrections
NeuralCoder3 Oct 25, 2022
62c08ae
moved phases, passes
NeuralCoder3 Oct 25, 2022
e15e605
removed duplicate files
NeuralCoder3 Oct 25, 2022
2888aaa
synchronized optimization order
NeuralCoder3 Oct 25, 2022
aed00fc
removed builder
NeuralCoder3 Oct 25, 2022
e94ebf4
update
NeuralCoder3 Oct 25, 2022
d30e495
cleanup
NeuralCoder3 Oct 26, 2022
d50ebe6
removed unused imports
NeuralCoder3 Oct 26, 2022
32635c8
fixed parsing error
NeuralCoder3 Oct 26, 2022
b17aa52
Merge branch 'master' into autodiff
NeuralCoder3 Oct 26, 2022
72e9dd0
readable error message
NeuralCoder3 Oct 26, 2022
cba4f59
fixed real test
NeuralCoder3 Oct 26, 2022
e967893
fixed secondary closure problem with higher order functions (by elmin…
NeuralCoder3 Oct 26, 2022
35be7ad
added optional filter annotation to expected output
NeuralCoder3 Oct 26, 2022
2444b29
split pow test in thorin and llvm part
NeuralCoder3 Oct 26, 2022
725f7ad
split toplevel memory operations
NeuralCoder3 Oct 26, 2022
fc15f7d
rewrote argument preparation
NeuralCoder3 Oct 26, 2022
db758c9
more toplevel updates
NeuralCoder3 Oct 26, 2022
27654d3
thoughts about autodiff_zero
NeuralCoder3 Oct 26, 2022
92fe7a9
update
NeuralCoder3 Oct 26, 2022
b641029
refactor extract
NeuralCoder3 Oct 26, 2022
23e4f1a
alphabetical order
NeuralCoder3 Oct 26, 2022
1b8d949
refactor
NeuralCoder3 Oct 26, 2022
d97bb60
refactor
NeuralCoder3 Oct 26, 2022
4a5c15d
separated memory functions
NeuralCoder3 Oct 27, 2022
aeca3d0
refactor
NeuralCoder3 Oct 28, 2022
f77617c
matrix.transpose differentiation
NeuralCoder3 Oct 28, 2022
100b680
code metric measurements
NeuralCoder3 Oct 31, 2022
169c9ff
visualization
NeuralCoder3 Oct 31, 2022
fd313e5
added impala files
NeuralCoder3 Oct 31, 2022
4dc44ed
Merge branch 'master' into autodiff
NeuralCoder3 Nov 2, 2022
dc22856
Merge branch 'autodiff' of https://github.com/NeuralCoder3/thorin2 in…
NeuralCoder3 Nov 2, 2022
a3daddd
removed get pullback function
NeuralCoder3 Nov 3, 2022
f173c28
Merge branch 'autodiff' into ad_ptr_merge
NeuralCoder3 Nov 3, 2022
9d4c253
more variants to try get it to work
NeuralCoder3 Nov 3, 2022
d89f551
Merge branch 'master' into autodiff
NeuralCoder3 Nov 4, 2022
d9fa330
additional test file
NeuralCoder3 Nov 4, 2022
8551c4f
merged
NeuralCoder3 Nov 4, 2022
0858ecc
working simplified test
NeuralCoder3 Nov 4, 2022
4b9ae49
fixed version 1
NeuralCoder3 Nov 4, 2022
1d0a08f
correctly fixed program
NeuralCoder3 Nov 4, 2022
9f8dae1
fixed (most) tests
NeuralCoder3 Nov 4, 2022
b8cb071
fixed memory test (now working)
NeuralCoder3 Nov 4, 2022
20bbd1f
format
NeuralCoder3 Nov 4, 2022
a455c0b
more informative error message
NeuralCoder3 Nov 4, 2022
0b66fba
Merge branch 'autodiff' into ad_ptr_merge
NeuralCoder3 Nov 4, 2022
66ccd45
fixed some more tests
NeuralCoder3 Nov 4, 2022
7dadddf
partially reverted tuple, app for now
NeuralCoder3 Nov 7, 2022
23f7244
split memory test in two parts to debug code gen in the presence/abse…
NeuralCoder3 Nov 7, 2022
965a811
disabled reshape (fixed 5 additional test cases) for now
NeuralCoder3 Nov 7, 2022
dd569fc
fixed non-memory tests
NeuralCoder3 Nov 7, 2022
c215f17
fixed zero application for now
NeuralCoder3 Nov 8, 2022
5253c78
rebuild correct memory tuple
NeuralCoder3 Nov 8, 2022
1779f61
create pullback for rebuild tuples
NeuralCoder3 Nov 8, 2022
8d00f43
simpler imperative memory test
NeuralCoder3 Nov 8, 2022
4688fca
association of (mostly) correct pullbacks
NeuralCoder3 Nov 8, 2022
393f8f6
found cps2ds error
NeuralCoder3 Nov 8, 2022
9c24614
fixed parser errors
NeuralCoder3 Nov 8, 2022
f86922d
more tests on the cps2ds issue
NeuralCoder3 Nov 9, 2022
428908c
Merge branch 'master' into autodiff
NeuralCoder3 Nov 9, 2022
d7b63e9
Merge branch 'autodiff' of https://github.com/NeuralCoder3/thorin2 in…
NeuralCoder3 Nov 9, 2022
50532e0
Merge branch 'autodiff' into ad_ptr_merge
NeuralCoder3 Nov 10, 2022
939456b
adapted test case
NeuralCoder3 Nov 10, 2022
ea6d984
more debugging
NeuralCoder3 Nov 10, 2022
fdf001c
merge bug test case from ad_ptr_merge branch
NeuralCoder3 Nov 10, 2022
7ad6892
Merge branch 'master' into direct_old_var
NeuralCoder3 Nov 10, 2022
50b3aef
Merge remote-tracking branch 'origin/optimize_phase_extensions' into …
NeuralCoder3 Nov 10, 2022
11e54e3
skeleton for add_mem conversion
NeuralCoder3 Nov 10, 2022
d410eb0
plan
NeuralCoder3 Nov 10, 2022
702d848
add mem
NeuralCoder3 Nov 11, 2022
66e55fb
removed eval
NeuralCoder3 Nov 14, 2022
b41b437
Merge branch 'master' into ad_ptr_merge
NeuralCoder3 Nov 14, 2022
e75ee79
Merge branch 'ad_ptr_merge' into ho_codegen
NeuralCoder3 Nov 14, 2022
94d8918
removed ad
NeuralCoder3 Nov 14, 2022
be2005f
merge ad from master
NeuralCoder3 Nov 14, 2022
b8a0c95
fixed name preservation for tests, small improvements
NeuralCoder3 Nov 15, 2022
734823a
add mem related tests
NeuralCoder3 Nov 15, 2022
28a2095
fixed tests
NeuralCoder3 Nov 15, 2022
480f812
added commands to failing tests
NeuralCoder3 Nov 15, 2022
d8afb79
arg style test
NeuralCoder3 Nov 15, 2022
35c4924
made functions external
NeuralCoder3 Nov 15, 2022
3178a71
tests without extern
NeuralCoder3 Nov 16, 2022
3ca0edc
add reshape flat
NeuralCoder3 Nov 16, 2022
4c292b7
test with preprocessor
NeuralCoder3 Nov 16, 2022
6f08aca
fixed test case lea access
NeuralCoder3 Nov 17, 2022
be1d7e1
fixed oblivious lea reconstruction
NeuralCoder3 Nov 17, 2022
1c46504
fixed more test cases for reshape (divergence)
NeuralCoder3 Nov 17, 2022
226ec64
fixed llvm codegen for conditionals
NeuralCoder3 Nov 17, 2022
81da58b
investigated disabled tests for clos
NeuralCoder3 Nov 17, 2022
005dc1a
moved reshape call to clos
NeuralCoder3 Nov 17, 2022
420984e
more robust testing
NeuralCoder3 Nov 17, 2022
212a498
Merge remote-tracking branch 'upstream/feature/add-mem' into ho_codegen
NeuralCoder3 Nov 18, 2022
1517b90
moved add mem to closure
NeuralCoder3 Nov 18, 2022
d72d448
added complex no mem test case
NeuralCoder3 Nov 18, 2022
5a1603b
Merge remote-tracking branch 'upstream/feature/add-mem' into ho_codegen
NeuralCoder3 Nov 22, 2022
d4094d7
Merge remote-tracking branch 'upstream/feature/add-mem' into ho_codegen
NeuralCoder3 Nov 23, 2022
897388e
Merge remote-tracking branch 'upstream/feature/add-mem' into ho_codegen
NeuralCoder3 Nov 24, 2022
b0aead5
resolved circular dependency
NeuralCoder3 Nov 29, 2022
6fbb8f6
Merge remote-tracking branch 'origin/master' into ho_codegen
NeuralCoder3 Nov 29, 2022
8e540be
merge reshape from ad_ptr_merge
NeuralCoder3 Nov 29, 2022
fdc74c7
handle external functions
NeuralCoder3 Nov 29, 2022
a076278
fixed handling of main function
NeuralCoder3 Nov 29, 2022
2d11419
merge ad_ptr_merge compilation extension
NeuralCoder3 Nov 29, 2022
4e08350
Merge remote-tracking branch 'origin/master' into ho_codegen
NeuralCoder3 Nov 30, 2022
f6fa75a
Merge remote-tracking branch 'origin/master' into test/direct_old_var
NeuralCoder3 Dec 2, 2022
31c8751
fixed tests
NeuralCoder3 Dec 2, 2022
03f8a59
updated test
NeuralCoder3 Dec 2, 2022
794726d
more attempts to fix cps2ds
NeuralCoder3 Dec 5, 2022
87cd669
fixed lambda rewrite
NeuralCoder3 Dec 5, 2022
1792c0a
refactoring
NeuralCoder3 Dec 5, 2022
eeaa8ab
add expected result
NeuralCoder3 Dec 5, 2022
a5b9c7b
re-enable curr nom print
NeuralCoder3 Dec 5, 2022
f88f568
more complex case
NeuralCoder3 Dec 5, 2022
8b3fa6a
removed comment
NeuralCoder3 Dec 5, 2022
cca49e6
rewrite recursively
NeuralCoder3 Dec 5, 2022
eae0fab
rewrite callee first
NeuralCoder3 Dec 5, 2022
668cd96
Merge remote-tracking branch 'origin/default-compilation' into ho_cod…
NeuralCoder3 Dec 5, 2022
87b6356
Merge remote-tracking branch 'origin/direct_fix' into ho_codegen
NeuralCoder3 Dec 6, 2022
fb1ec79
Merge remote-tracking branch 'origin/default-compilation' into ho_cod…
NeuralCoder3 Dec 6, 2022
299da40
only reshape small arrays
NeuralCoder3 Dec 7, 2022
78a8a13
move mem to front (for closure)
NeuralCoder3 Dec 8, 2022
d6f4ae2
Merge branch 'ho_codegen' of https://github.com/NeuralCoder3/thorin2 …
NeuralCoder3 Dec 8, 2022
4733334
merge
NeuralCoder3 Dec 8, 2022
9de0b35
allow for additional backends
NeuralCoder3 Dec 8, 2022
43bbf4d
removed empty function
NeuralCoder3 Dec 8, 2022
6a187f9
start of haskell backend
NeuralCoder3 Dec 8, 2022
4af170b
function shape
NeuralCoder3 Dec 8, 2022
ff2980c
start of haskell emitting
NeuralCoder3 Dec 8, 2022
685d2f1
add mem tests
NeuralCoder3 Dec 9, 2022
fe95409
do not overwrite mem from non-apps
NeuralCoder3 Dec 9, 2022
0add729
some comments
NeuralCoder3 Dec 9, 2022
f528b4b
error reporting script
NeuralCoder3 Dec 9, 2022
5b7d6bb
tuple
NeuralCoder3 Dec 9, 2022
3977590
dumper based emitter
NeuralCoder3 Dec 9, 2022
92c2a2e
switched to OCaml
NeuralCoder3 Dec 12, 2022
f961510
removed comments
NeuralCoder3 Dec 12, 2022
0ce1c6f
example code
NeuralCoder3 Dec 12, 2022
9b1d2f6
todos, fixes
NeuralCoder3 Dec 12, 2022
1fe61ac
syntax highlight
NeuralCoder3 Dec 12, 2022
0e6f52c
correctly negated check
NeuralCoder3 Dec 13, 2022
a3c67d9
Merge branch 'ho_codegen' of https://github.com/NeuralCoder3/thorin2 …
NeuralCoder3 Dec 13, 2022
a5a7595
merge codegen fixes from matrix
NeuralCoder3 Dec 20, 2022
0a96f0f
Merge branch 'ho_codegen' of https://github.com/NeuralCoder3/thorin2 …
NeuralCoder3 Dec 20, 2022
255797e
generalized internal cleanup
NeuralCoder3 Dec 22, 2022
5e2b2ea
more cases, complicated test case
NeuralCoder3 Dec 22, 2022
2d38fe5
emitter phase
NeuralCoder3 Dec 22, 2022
6c0024c
register phase
NeuralCoder3 Dec 23, 2022
f360a89
Merge remote-tracking branch 'origin/ho_codegen' into haskell-backend
NeuralCoder3 Dec 23, 2022
9e05da4
fix merge
NeuralCoder3 Dec 23, 2022
7d6871c
register emitter phase
NeuralCoder3 Dec 23, 2022
42a2431
completed backend (working pow test)
NeuralCoder3 Feb 1, 2023
1d42191
more complex test
NeuralCoder3 Feb 3, 2023
3d48e2a
naming
NeuralCoder3 Feb 3, 2023
b925f8a
thorin opt timing test
NeuralCoder3 Feb 3, 2023
12e1ac2
haskell backend
NeuralCoder3 Feb 3, 2023
06ffc75
timing tests
NeuralCoder3 Feb 3, 2023
4de7655
thorin time
NeuralCoder3 Feb 3, 2023
6a701f7
updated tests
NeuralCoder3 Feb 6, 2023
d34d699
rust timing
NeuralCoder3 Feb 6, 2023
c834870
updated tests
NeuralCoder3 Feb 7, 2023
d5e582f
explanation
NeuralCoder3 Feb 7, 2023
0878018
rust backend
NeuralCoder3 Feb 9, 2023
d940d00
cleanup comments
NeuralCoder3 Feb 9, 2023
8408bd5
static vs dynamic dispatch in rust
NeuralCoder3 Feb 13, 2023
3585006
reversed skeleton of minimal emitter from llvm backend
NeuralCoder3 Feb 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
made functions external
  • Loading branch information
NeuralCoder3 committed Nov 15, 2022
commit 35c49248008d991b4625172873e0c14b7b2101d7
35 changes: 19 additions & 16 deletions lit/mem/arg_style.thorin
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,64 @@
.let I32 = .Idx _32;
.let Tas = (I32, 0);

.con f1 [mem: %mem.M, a: I32, ret: .Cn [%mem.M, I32]] = {
// We want the functions to be extern.
// Functions with argstyle might stay until code gen and can not be inlined in general.
// Therefore, we need to handle them explicitely.
// As such functions prevent code gen, we want to ignore the extern flag.

.con .extern f1 [mem: %mem.M, a: I32, ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con f2 [[mem: %mem.M, a: I32], ret: .Cn [%mem.M, I32]] = {
.con .extern f2 [[mem: %mem.M, a: I32], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con g1 [mem: %mem.M, a: I32, b:I32, ret: .Cn [%mem.M, I32]] = {
.con .extern g1 [mem: %mem.M, a: I32, b:I32, ret: .Cn [%mem.M, I32]] = {
.let c = %core.wrap.add _32 0 (a,b);
ret (mem,c)
};

.con g2 [[mem: %mem.M, a: I32, b:I32], ret: .Cn [%mem.M, I32]] = {
.con .extern g2 [[mem: %mem.M, a: I32, b:I32], ret: .Cn [%mem.M, I32]] = {
.let c = %core.wrap.add _32 0 (a,b);
ret (mem,c)
};

.con g3 [[mem: %mem.M, [a: I32, b:I32]], ret: .Cn [%mem.M, I32]] = {
.con .extern g3 [[mem: %mem.M, [a: I32, b:I32]], ret: .Cn [%mem.M, I32]] = {
.let c = %core.wrap.add _32 0 (a,b);
ret (mem,c)
};

.con g4 [mem: %mem.M, [a: I32, b:I32], ret: .Cn [%mem.M, I32]] = {
.con .extern g4 [mem: %mem.M, [a: I32, b:I32], ret: .Cn [%mem.M, I32]] = {
.let c = %core.wrap.add _32 0 (a,b);
ret (mem,c)
};

.con h1 [mem: %mem.M, a: I32, x:%mem.Ptr (I32, 0), ret: .Cn [%mem.M, I32]] = {
.con .extern h1 [mem: %mem.M, a: I32, x:%mem.Ptr (I32, 0), ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con h2 [mem: %mem.M, [a: I32, x:%mem.Ptr (I32, 0)], ret: .Cn [%mem.M, I32]] = {
.con .extern h2 [mem: %mem.M, [a: I32, x:%mem.Ptr (I32, 0)], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con h3 [[mem: %mem.M, a: I32, x:%mem.Ptr (I32, 0)], ret: .Cn [%mem.M, I32]] = {
.con .extern h3 [[mem: %mem.M, a: I32, x:%mem.Ptr (I32, 0)], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con h4 [[mem: %mem.M, [a: I32, x:%mem.Ptr (I32, 0)]], ret: .Cn [%mem.M, I32]] = {
.con .extern h4 [[mem: %mem.M, [a: I32, x:%mem.Ptr (I32, 0)]], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con e1 [mem: %mem.M, a: I32, [], ret: .Cn [%mem.M, I32]] = {
.con .extern e1 [mem: %mem.M, a: I32, [], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con e2 [mem: %mem.M, [a: I32, []], ret: .Cn [%mem.M, I32]] = {
.con .extern e2 [mem: %mem.M, [a: I32, []], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

.con e3 [[mem: %mem.M, [a: I32, []]], ret: .Cn [%mem.M, I32]] = {
.con .extern e3 [[mem: %mem.M, [a: I32, []]], ret: .Cn [%mem.M, I32]] = {
ret (mem,a)
};

Expand All @@ -69,11 +74,9 @@
.let (mem2,p) = %mem.alloc Tas mem;
// .let mem3 = %mem.store Tas (mem2, p, argc);

// .con cont_f1 [mem:%mem.M, v:I32] = {
// .con .extern cont_f1 [mem:%mem.M, v:I32] = {
// f1 ()
// };
return (mem2, argc)

};

// TODO: check for 1+x, 2+x, a+b