The Role of Giant Planets in Terrestrial Planet Formation