Optimise the code generated at trace points