Analysing variable sharing in a co-design compiler