We know diets of some ichthyosaurs from the stomach contents preserved in
fossils. Since not every fossil comes with good stomach contents, our
knowledge is limited to some fish-shaped ichthyosaurs.
As early as 1853, Coles noticed that there were unusual structures
preserved in the trunk region of ichthyosaurs (figure below). He thought
they might have been the scales of ichthyosaurs, but later scientists
realized that these were indeed hooklets of squid-like creatures (extinct
dibranchiate cephalopods, mostly belemnites).
Since then, there have been several good studies on ichthyosaurian stomach
contents, which revealed that many fish-shaped ichthyosaurs relied heavily
on ancient kin of squids for their foods. Even Temnodontosaurus, a large
Jurassic ichthyosaur that sometimes reached 10 meters in body length, had
preference for squids, although it probably ate large vertebrates from
time to time. Beside squid-like creatures, ichthyosaurs ate fish and other
marine organisms.
In short, many fish-shaped ichthyosaurs were squid eaters, as in some
whales today.