summaryrefslogtreecommitdiff
path: root/src/jib/jib_optimize.mli
AgeCommit message (Collapse)Author
2019-10-28Some C backend refactoringAlasdair
Make it so that jib_compile.ml never relies on specific string encodings for various constructs in C. Previously this happened when monomorphisation occured for union constructors and fields, i.e. x.foo -> x.zfoo_bitsz632z7 Now identifiers that can be modified are represented as (id, ctyp list) tuples, so we can keep the types x.foo -> x.foo::<bits(32)> This then enables us to do jib IR -> jib IR rewrites that modify types In particular there is now a rewrite that removes tuples as an IR->IR pass rather than doing it ad-hoc in the C code generation, although this is not on by default Note that this change seems to have triggered an Ott bug so jib.lem is now checked in and not generated from Ott
2019-10-25Refactor Jib IR pretty printerAlasdair Armstrong
2019-04-16SMT: Fix inlining issuesAlasdair Armstrong
2019-04-09SMT: Refactor Jib values to make inlining workAlasdair Armstrong
Had to change the hundreds and hundreds of places such values were used. However this now lets us automatically prove cheri-concentrate properties. Such as showing function prop_cap_round_trip(cap: bits(128)) -> bool = { let cap_rt = capToBits(capBitsToCapability(true, cap)); cap == cap_rt } is always true.
2019-03-19C: Inlining supportAlasdair Armstrong
Add a function Jib_optimize.inline which can inline functions. To make this more efficient, we can make identifiers unique on a per-function basis.
2019-03-13C: Improve Jib IR, add SSA representationAlasdair Armstrong
Add a CL_void l-expression so we don't have redundant unit-typed variables everywhere, and add an optimization in Jib_optimize called optimize_unit which introduces these. Remove the basic control-flow graph in Jib_util and add a new mutable control-flow graph type in Jib_ssa which allows the IR to be converted into SSA form. The mutable graph allows for more efficient updates, and includes both back and forwards references making it much more convenient to traverse. Having an SSA representation should make some optimizations much simpler, and is also probably more natural for SMT generation where variables have to be defined once using declare-const anyway. Debug option -ddump_flow_graphs now outputs SSA'd graphs of the functions in a specification.