LICM: Hoist insertvalue/extractvalue out of loops.

Fixes PR14854.