The Dow gained 1%, the S&P climbed 1.2% and the Nasdaq soared 1.7%.

Friday's rally was fueled by chipmakers and other heavyweight tech stocks on optimism around artificial intelligence.

Shares of server maker Super Micro Computer soared 36% after it lifted its second-quarter profit forecast.

That sparked gains in chipmakers Qualcomm, Marvell Technology and Nvidia - all up more than 4%.

Chipmaker stocks have gained since Taiwan Semiconductor Manufacturing Company, the world's largest contract chipmaker, said earlier this week that it saw booming demand for high-end chips used in AI. It's U.S.-listed shares gained another 1% on Friday after climbing 10% the prior session.

Dryden Pence, Chief Investment Officer at Pence Capital Management, says TSMC's industry dominance makes it a great long-term holding.

"So when you think about AMD and you think about NVIDIA, you think about all these companies, you have to recognize that about 40% of what they do is a Taiwan Semi chip. And so rather than have all those companies, have the biggest thing that they have to have. And so when Taiwan, somebody is so dominant, they have pricing power, pricing power turns into excess earnings. We just saw that. And I think that that's a theme that's going to continue to go."

Microsoft and Apple, the world's two most valuable companies, also each rose more than 1%.

In other company news, Travelers jumped more than 6.5% after the insurer's fourth-quarter profit more than doubled.

Shares of Spirit Airlines rebounded by more than 17% from losses earlier this week as it assessed options to refinance its 2025 debt maturities amid concerns over the airline's financial future.

And iRobot slumped 27% after a report said the European Union's competition watchdog plans to block Amazon's $1.4-billion acquisition of the robot vacuum maker.