[4.8] Backport vectorizer cost model enhancement

Backport of r202980 from trunk by davidxl