V4 IR: make the local-with-temp substitution into a separate pass.

This makes it easier to turn it off when needed.

Change-Id: I1a9f2882dd7a1ad7bc76143e3c44e4677e49357a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>