diff options
| author | Alasdair Armstrong | 2018-06-20 17:12:04 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-06-21 14:27:17 +0100 |
| commit | 5489108f054fb51aa190e1fda847d8ab59ee915b (patch) | |
| tree | 16a1c4fa7b8af2f06acd036f80c13c8e64d9d25d /language | |
| parent | 4a09a35164be81467feea154ef7651ef96eaad88 (diff) | |
Simplify the ANF->IR translation
Previously the ANF->IR translation cared too much about how things
were allocated in C, so it had to constantly check whether things
needed to be allocated on the stack or heap, and generate different
cequences of IR instructions depending on either. This change removes
the ialloc IR instruction, and changes iinit and idecl so that the
code generator now generates different C for the same IR instructions
based on the variable types involved.
The next change in this vein would be to merge icopy and iconvert at
the IR level so that conversions between uint64_t and large-bitvectors
are inserted by the code generator. This would be good because it
would make the ANF->IR translation more robust to changes in the types
of variables caused by flow-typing, and optimization passes could
convert large bitvectors to uint64_t as local changes.
Diffstat (limited to 'language')
| -rw-r--r-- | language/bytecode.ott | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/language/bytecode.ott b/language/bytecode.ott index bcd7b5b0..895ac34b 100644 --- a/language/bytecode.ott +++ b/language/bytecode.ott @@ -122,7 +122,6 @@ iannot :: 'IA_' ::= instr :: 'I_' ::= {{ aux _ iannot }} | ctyp id :: :: decl - | alloc ctyp id :: :: alloc | ctyp id = cval :: :: init | if ( cval ) { instr0 ; ... ; instrn } else { instr0 ; ... ; instrm } : ctyp :: :: if @@ -150,8 +149,6 @@ cdef :: 'CDEF_' ::= | ctype_def :: :: type | let nat ( id0 : ctyp0 , ... , idn : ctypn ) = { instr0 ; ... ; instrm - } { - instr0 ; ... ; instri } :: :: let % The first list of instructions creates up the global letbinding, the % second kills it. |
