Improve invariant code motion