openfimg: Generalize node_stack into generic growing stack

So it can be reused outside of openfimg_compiler.c.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Fix calculation of number of variables

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Refactor variables_defined()

Now it resembles more closely the algorithm from the article and is a
bit more readable.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Rename var_bitmap_bits to num_vars

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Fix repeat node numbering

Repeat number 0 is reserved for loop entry.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Change of_ir_phi struct to be more useful

It needs to store variable number just once, while destination and
sources are just versions.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Implement variable renaming

This gives us a program in SSA form, although I'm not yet sure if it's
fully correct...

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Implement printing variable version in AST dump

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>