This change does essentially the same thing as D109368 but in a slightly different way. Instead of doing late evaluation of cost of runtime checks in LoopVectorizationPlanner here we do it directly in the CostModel.
I greatly reworked this patch since the original questions so not sure if it still matters....Anyway the intention of this patch was to replace D109368. It achieves the same effect by a slightly different way. Namely cost of runtime checks are embedded into main step of cost calculation. Note that we still can land D109368 first and apply this one later (rebase required)