Both the S&P 500 and Nasdaq Composite indexes are hovering around all-time highs. Unsurprisingly, a euphoric narrative surrounding all things touching artificial intelligence (AI) has helped fuel stock prices into the stratosphere.

It's no secret that valuations in the technology sector are frothy right now. But even so, smart investors have been able to identify some under-the-radar value opportunities.

While companies such as Nvidia, Broadcom, and Advanced Micro Devices fetch a lot of attention in the semiconductor landscape, I'd encourage investors to take a hard look at one of their peers: Taiwan Semiconductor Manufacturing (TSM 3.17%).

Let's explore TSMC's unique role in the chip market, as well as the company's long-term growth prospects and current valuation trends. In my eyes, TSMC is both underappreciated and undervalued, but these dynamics might not last for much longer.

What does Taiwan Semiconductor do?

Semiconductor companies have been some of the biggest beneficiaries throughout the AI revolution. But why?

Chipsets known as graphics processing units (GPUs) are capable of running sophisticated algorithms in parallel, helping businesses achieve breakthroughs across myriad generative AI applications more efficiently. Nvidia and AMD are the two market leaders in GPU design right now.

In addition, companies like Broadcom supply a host of network infrastructure equipment and services needed to outfit data centers with the most advanced AI architectures.

In the background lies TSMC. The company specializes in fabrication and foundry services that help bring chips from the design phase to an actual, physical product. According to data compiled by TrendForce, TSMC holds a 68% share of the global wafer foundry market.

Considering TSMC's massive lead over the competition, it's important for investors to understand just how much companies such as Nvidia and many other leading AI developers rely on it.

Chips manufactured on an assembly line in a factory.

Image source: Getty Images.

Wall Street is bullish and it's easy to see why

According to Market.us, the total addressable market for semiconductors is expected to reach $996 billion by 2033 -- up from $530 billion just two years ago.

Market.us goes on to project that the semiconductor foundry market will witness an 8.5% compound annual growth rate (CAGR) between 2024 and 2033 -- reaching a size of $276 billion by early next decade.

To support these forecasts, consider that global management consulting firm McKinsey & Company reports that AI infrastructure spend could reach nearly $7 trillion by the middle of next decade. Moreover, the firm suggests that chips and related hardware for AI data centers will receive nearly half of this allocated spend.

TSM Revenue Estimates for Current Fiscal Year Chart

TSM Revenue Estimates for Current Fiscal Year data by YCharts

These secular trends all bode well for TSMC, as rising demand for chips is a direct tailwind for the company's foundry business. Per the figures above, Wall Street analysts are calling for continued revenue and earnings acceleration for TSMC over the next few years as the company seeks to capitalize on rising infrastructure spend.

Is Taiwan Semiconductor stock a buy right now?

With a forward price-to-earnings (P/E) ratio of 24.3, TSMC is trading at a considerable discount when benchmarked against many other leading chip stocks. What is a bit ironic is that companies such as Nvidia, AMD, and Broadcom rely heavily on TSMC's services, and yet the market places a premium on those businesses over TSMC's.

TSM PE Ratio (Forward) Chart

TSM PE Ratio (Forward) data by YCharts

As explored above, TSMC is the king of fabrication and foundry services given its market-leading position. Moreover, rising capital expenditures from cloud hyperscalers and continued investment in data center infrastructure suggests that demand for chips remains robust. As a result, TSMC has a high degree of visibility into its future growth prospects.

Although TSMC's valuation is higher than historical averages, it remains at a considerable discount to levels seen throughout the back half of 2024. If anything, though, its growth narrative has strengthened over the last several months. For these reasons, it may not be flying under the radar for too much longer.

With those factors in mind, I think the company's current price is reasonable and I see Taiwan Semiconductor as a hidden bargain in a sea of overpriced growth stocks right now. This is a compelling buy-and-hold opportunity for investors with a long-run time horizon.