Haswell without a doubt.
In real world, haswell brings only 10% of an increased performance than the Ivy Bridge.
Hower, the motherboard compatibilty plays an important role. z77 (for Ivy Bridge) has less features than the z87 (for Haswell). So with more/better features of the z87, a good/stable Overclock can be achieved.
And if you plan to game, get the 4th gen i5. The only difference between i5 and i7 is Hyperthreading. And games have no use of hyperthreading.