VK
Приятно видеть теперь, что уже в некотором виде возникают запросы на английский перевод :)
Правда, я сам пока что хотел бы доработать wiki (много накопилось материалов), а не заниматься переводом.
Size: a a a
VK
BD
AT
VY
cannon.ml: http://ix.io/28an, ir.ml: http://ix.io/28ao)reorder, вот её описание (я немного перефразировал для себя, но смысл не затронут):Takes a [Ir.expr list] and returns a [(Ir.stmt, Ir.expr list)]. The first element [Ir.stmt] contains all the things that must be executed before the expression list [Ir.expr list]. This includes all the statement-parts of the [Ir.ESeq]'s, as well as any expressions to their left with which they did not commute.И пример:
(Remember, if [Ir.stmt] and [Ir.expr] don't "commute" then we can't change the order of their evaluation)
[e1; e2; ESeq(s, e3)]Я не понимаю
[s] must be pulled leftward past [e2] and [e1].
(0) If they all commute our [reorder] function will return
[(stmt, exprs)] where:
stmt := s
exprs := [e1; e2; e3]
(1) If [commute s e1 = true] and
[commute s e2 = false]
stmt := Seq(Move(t1, e1), Seq(Move(t2, e2), s))
exprs := [Temp t1; Temp t2; e3]
(2) If [commute s e1 = false] and
[commute s e2 = true]
stmt := Seq(Move(t1, e1), s)
exprs := [Temp t1; e2; e3]
(3) If all don't commute - same as (1)
(1), а именно почему нужно Move(t1, e1).stmt := Seq(Move(t2, e2), s)?
exprs := [e1; Temp t2; e3]
VY
e1 обязательно должно быть перед e2, тк это может быть Call или ESeq. Т.е. выражения e1, e2 и e3 тут (между собой) не "коммутативны" в том смысле, что они всегда потенциально с побочными эффектами в виде Call или ESeq(stmt, expr) и их нельзя переставлять местами, очевидно :)M
МБ
e1 обязательно должно быть перед e2, тк это может быть Call или ESeq. Т.е. выражения e1, e2 и e3 тут (между собой) не "коммутативны" в том смысле, что они всегда потенциально с побочными эффектами в виде Call или ESeq(stmt, expr) и их нельзя переставлять местами, очевидно :)VY
P🛸
M
P🛸
TS
DP
AH
M
AH
M
M
AT
JC