Currently the recipe for a cast instruction is not recorded, if the
using first-order recurrence comes *after* the optimized phi.
This patch adjusts the code to always record the recipe for optimized
cast instructions. This requires a bit of extra logic to check whether
recording was already requested.