Feb 5 (Reuters) - Canada's main stock index gave back on Thursday much of its gains from earlier in the week, as investors grappled with renewed declines in the precious metals market and the potential for companies to overspend on AI.

The S&P/TSX composite index ended down 576.95 points, or 1.8%, at 31,994.60, after gains in the previous three sessions.

"It's mostly resource companies," said Colin Cieszynski, chief market strategist at SIA Wealth Management. "This is what happens to us when all of the commodities sell off all at once."

The materials index, which includes metal mining shares, dropped 6.5% as gold and silver tanked. The latter was down nearly 17% as a stronger U.S. dollar and a broad market rout prompted investors to liquidate precious metal holdings.

Shares of Barrick Mining lost 8.5% after the company said it would move forward with preparations for an initial public offering of its North American gold assets and named interim head Mark Hill as its chief executive and president.

The price of oil settled 2.8% lower on easing Iranian supply concerns, which led to a decline of 1.2% for the energy sector.

Wall Street also tumbled, weighed down by losses for tech heavyweights after Alphabet said it could double capital spending on AI in the race to dominate the emerging technology.

Canada Goose Holdings missed analysts' estimates for third-quarter profit, hurt by an increase in marketing and promotional spending, sending the luxury apparel maker's shares tumbling by nearly 20%.

Thomson Reuters reported higher fourth-quarter revenue, boosted by its legal, tax and accounting and corporates businesses, as investors assess the impact of artificial intelligence companies moving into its key markets. Still, its shares ended 5.4% lower, adding to recent sharp declines.

Just two of the 10 major sectors on the TSX ended higher, including technology. It added 0.7%, with shares of electronic equipment company Celestica up 6.5%.

(Reporting by Fergal Smith and Nikhil Sharma; Editing by Shreya Biswas, Rod Nickel)

By Fergal Smith