-
Notifications
You must be signed in to change notification settings - Fork 0
Ad ptr merge #1
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
base: autodiff
Are you sure you want to change the base?
Ad ptr merge #1
Changes from 40 commits
d7734e9
852cb9b
be44cd1
eb278a9
4792258
d4094d7
1022cad
36f0ae1
c6eb5bf
6603b23
4916de9
9f546d1
ed42d16
eb3876b
897388e
597f549
5711298
e7c3f0d
4cb5d7f
c7df887
75ad11c
e347a86
714abfe
48b73f2
f166fe0
7a9b6c2
b6d5894
a9431f1
8e419b9
b7f0586
64e48c4
ff7dfaf
a8d2574
9f608a7
3d8678a
11e373f
834a296
541d066
e2a3d09
2d14b3b
8f241c7
a62cbe6
2b6b308
600b275
c10a7a4
f38a028
bfae070
ba3f6ef
24100bc
78ecf47
46c86eb
104b3f9
a3c7cc8
0309dfc
dacb524
edc357e
9e5a3b3
c1312e7
5d44e60
e31d670
fa7edf3
da44974
b549402
2a9d714
e1acb84
a3f2b48
c0c535c
90ab9aa
370c3e1
85b75fc
6c7d7ae
b5e0d28
9b5a44f
b0aead5
6fbb8f6
3d2d2e6
01a2443
8e540be
2695181
fdc74c7
a076278
a19b5fa
696f819
3253246
2d11419
ed05055
5d6001b
0a81597
4447ddc
cf90b96
3548bf9
63e5c5b
4f7868c
e1e58ef
e76d435
bc7e83c
71cfba5
a9ead4c
c38c172
1a6ecf0
fa3a45e
e9ce242
8012df2
4e08350
191336d
fddd4ac
68b818a
6ab5377
de2b495
6cd4b93
c46517d
f6fa75a
31c8751
55d0023
9a7fb9a
b5dbb13
277d500
03f8a59
da4f40e
794726d
87cd669
1792c0a
eeaa8ab
a5b9c7b
f88f568
8b3fa6a
cca49e6
eae0fab
668cd96
ac00883
702605d
319d3f6
3c48c8f
4fc5705
bf924e1
538819f
7290afe
8d9c0c5
a1a1cbe
8336944
2421f81
de777ff
87b6356
d395385
e6c494e
8dbfeb2
b925217
6d9b791
df9eb5f
7269d64
fb1ec79
f59c230
062be31
a7ff1a8
d34c575
01b7af8
98b25b2
1b0f9fc
367ba55
93a9646
45dfa94
4415b8a
299da40
1c43d60
86799e8
8a56cf0
78a8a13
d6f4ae2
4733334
685d2f1
fe95409
0add729
f528b4b
9994590
491c0b4
36ab407
a9597ee
1102f70
be4a3e6
3b4e086
bc3767f
f66228a
a5ab96c
dfe46a7
b85670a
1fe61ac
64d27ed
0e6f52c
a3c67d9
736d3dc
a49df1c
46f3b04
a771115
3eec6a4
f6c7bd0
ebac94e
f5bb4d1
248a9f6
1bbe9fb
315f7f0
866d585
f7118fb
3b22f21
aa28d02
e603f69
d3c0b84
7169584
095be62
9e32eb5
cbb799a
7d321f8
3cf2838
05604bf
2810df7
202d1a5
a5a7595
0a96f0f
255797e
fe3283b
1f05ef0
6c0024c
8954d72
50e46bc
5817fd2
0b1f9b9
8fa2502
76bb125
7ee94ce
bc63865
a2977e5
5d6034a
bc69ec0
d02b0b9
6968dea
5174465
6a524b2
ee33da0
b8cb88b
d16bb4a
995beac
a5748e7
10f0cf2
04c5f38
eb65880
39974b4
22251d1
9fc843c
b88a56b
100ca64
239ffe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
*.s | ||
.DS_Store | ||
.cache | ||
build* | ||
build*/ | ||
vgcore.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#include "dialects/affine/affine.h" | ||
|
||
#include <thorin/config.h> | ||
#include <thorin/pass/pass.h> | ||
|
||
#include "thorin/dialects.h" | ||
|
||
#include "dialects/affine/affine.h" | ||
#include "dialects/affine/passes/lower_for.h" | ||
|
||
extern "C" THORIN_EXPORT thorin::DialectInfo thorin_get_dialect_info() { | ||
return {"affine", | ||
[](thorin::PipelineBuilder& builder) { | ||
builder.extend_opt_phase([](thorin::PassMan& man) { man.add<thorin::affine::LowerFor>(); }); | ||
builder.extend_opt_phase(106, [](thorin::PassMan& man) { man.add<thorin::affine::LowerFor>(); }); | ||
}, | ||
nullptr, nullptr}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,16 +37,16 @@ const Def* LowerFor::rewrite(const Def* def) { | |
|
||
// reduce the body to remove the cn parameter | ||
auto nom_body = body->as_nom<Lam>(); | ||
auto new_body = nom_body->stub(w, w.cn(w.sigma()), body->dbg()); | ||
new_body->set(nom_body->reduce(w.tuple({iter, acc, yield_lam}))); | ||
auto new_body = nom_body->stub(w, w.cn(acc->type()), body->dbg()); | ||
new_body->set(nom_body->reduce(w.tuple({iter, new_body->var(), yield_lam}))); | ||
|
||
// break | ||
auto if_else_cn = w.cn(w.sigma()); | ||
auto if_else_cn = w.cn(acc->type()); | ||
auto if_else = w.nom_lam(if_else_cn, nullptr); | ||
if_else->app(false, brk, acc); | ||
if_else->app(false, brk, if_else->var()); | ||
|
||
auto cmp = core::op(core::icmp::ul, iter, end); | ||
for_lam->branch(false, cmp, new_body, if_else, w.tuple()); | ||
for_lam->branch(false, cmp, new_body, if_else, acc); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @christopherhjung |
||
} | ||
|
||
DefArray for_args{for_ax->num_args() - 2, [&](size_t i) { return for_ax->arg(i); }}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if inter-dialect phases are necessary here.