# GRIN [![Build Status](https://travis-ci.org/andorp/grin.svg?branch=master)](https://travis-ci.org/andorp/grin) The name GRIN is short for *Graph Reduction Intermediate Notation*, and it is an intermediate language for graph reduction. For an overview read The GRIN Project article. To grasp the details take your time and read Urban Boquist's PhD thesis on Code Optimisation Techniques for Lazy Functional Languages . Also check the performance [benchmark](https://rawgit.com/andorp/grin/master/grin/grin-benchmark.html). ## Simplifying Transformations Transformation | Schema -------------- | ------ [vectorisation][113]

_source code:_
[Vectorisation2.hs] | [][113] [case simplification][116]

_source code:_
[CaseSimplification.hs] | [][116] [split fetch operation][118]

_source code:_
[SplitFetch.hs] | [][118] [right hoist fetch operation][123]

_source code:_
[RightHoistFetch2.hs] | [][123] [register introduction][126]

_source code:_
[RegisterIntroduction.hs] | [][126] [113]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=113 [116]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=116 [118]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=118 [123]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=123 [126]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=126 [Vectorisation2.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Simplifying/Vectorisation2.hs [CaseSimplification.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Simplifying/CaseSimplification.hs [SplitFetch.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Simplifying/SplitFetch.hs [RightHoistFetch2.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Simplifying/RightHoistFetch2.hs [RegisterIntroduction.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Simplifying/RegisterIntroduction.hs ## Optimising Transformations Transformation | Schema -------------- | ------ [evaluated case elimination][141]

_source code:_
[EvaluatedCaseElimination.hs] | [][141] [trivial case elimination][142]

_source code:_
[TrivialCaseElimination.hs] | [][142] [sparse case optimisation][143]

_source code:_
[SparseCaseOptimisation.hs] | [][143] [update elimination][148]

_source code:_
[UpdateElimination.hs] | [][148] [copy propagation][129]

_source code:_
[CopyPropagation.hs] | [][129] [late inlining][151]

_source code:_
[Inlining.hs] | [][151] [generalised unboxing][134]

_source code:_
__TODO__ | [][134] [arity raising][160]

_source code:_
__TODO__ | [][160] [case copy propagation][144]

_source code:_
[CaseCopyPropagation.hs] | [][144] [case hoisting][153]

_source code:_
__TODO__ | [][153] [whnf update elimination][149]

_source code:_
__TODO__ | [][149] [common sub-expression elimination][164]

_source code:_
[CSE.hs] | [][164] [constant propagation][159]

_source code:_
[ConstantPropagation.hs] | [dead procedure elimination][169]

_source code:_
[DeadProcedureElimination.hs] | [dead variable elimination][170]

_source code:_
[DeadVariableElimination.hs] | [dead parameter elimination][171]

_source code:_
__TODO__ | [129]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=129 [134]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=134 [141]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=141 [142]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=142 [143]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=143 [144]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=144 [148]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=148 [149]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=149 [151]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=151 [153]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=153 [159]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=159 [160]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=160 [164]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=164 [169]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=169 [170]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=170 [171]: http://nbviewer.jupyter.org/github/andorp/grin/blob/master/papers/boquist.pdf#page=171 [ConstantPropagation.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/ConstantPropagation.hs [CopyPropagation.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/CopyPropagation.hs [CaseCopyPropagation.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/CaseCopyPropagation.hs [CSE.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/CSE.hs [DeadProcedureElimination.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/DeadProcedureElimination.hs [DeadVariableElimination.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/DeadVariableElimination.hs [EvaluatedCaseElimination.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/EvaluatedCaseElimination.hs [Inlining.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/Inlining.hs [SparseCaseOptimisation.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/SparseCaseOptimisation.hs [TrivialCaseElimination.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/TrivialCaseElimination.hs [UpdateElimination.hs]: https://github.com/andorp/grin/blob/master/grin/src/Transformations/Optimising/UpdateElimination.hs