Semiconductor stocks got clobbered in 2022 as a severe downturn in chip sales weighed heavily on investor sentiment. But the world's largest chip foundry, Taiwan Semiconductor Manufacturing (TSM 1.26%), also known as TSMC, proved resilient amid those broad sales declines.

An epic run of growth has finally come to an end, though. The company now anticipates its first decline in revenue since 2019. But does that mean it's time to sell shares of one of the world's most important companies?

TSM Revenue (TTM) Chart

Data by YCharts.

What's eating TSMC?

Though many chip companies that are focused on the big PC and smartphone markets fell hard during the bear market of 2022, TSMC was able to sail through the storm owing to its focus on performing the most advanced chipmaking -- especially for the chips that data centers need to train and power artificial intelligence (AI) models like ChatGPT. (Thanks, Nvidia!)

The pain is finally reaching TSMC, though, because of global macroeconomic uncertainty. As many of its customers are trying to conserve cash this year (a recession in 2023 still hasn't been completely ruled out by some economists), not even booming AI chip sales will save TSMC from a decline in revenue. Additionally, there's still excess inventory out there, especially for PC and smartphone chips, so TSMC is working with customers to reduce inventory by dialing back the manufacture of new wafers.

As a result, the company reported a 10% year-over-year decline in Q2 2023 to NT$481 billion ($15.7 billion using new-Taiwanese-dollar-to-U.S.-dollar exchange rates on July 20, 2023). CEO C.C. Wei said TSMC "now expects the foundry industry to decline mid-teens [percentage], and our full-year 2023 revenue to decline around 10% in U.S. dollar terms."

Gearing up for the next run higher

Before you hit that sell button, consider a few points. 

First, TSMC is still far and away the world's largest and most-trusted third-party foundry. Even as such, it goes through ups and downs in revenue, like any manufacturing business does. Growing long-term demand for chips globally is still the broad expectation (to the tune of about 7% annually through 2030). 2023 is likely to be merely a speed bump on that road.  

Second, TSMC has the most advanced semiconductor manufacturing technology, a lead it and the Taiwanese government want to vigorously defend against South Korea's Samsung and Intel (INTC -9.20%) in the U.S. In Q2, 53% of TSMC's revenue came from advanced chips using the 7-nm and smaller process nodes. (These numbers reference the shrinking sizes of the transistors in the chips, with smaller numbers allowing for higher transistor density and thus greater computing power. But it has been years since they accurately reflected the size of a single transistor in nanometers -- these days, it's simply a naming convention for what generation of process technology is being used.)

Things like cloud computing, 5G networks, and AI are fueling more demand for the type of manufacturing that only TSMC can perform, and it has the means to keep investing to maintain its lead. As Wei said on the earnings call:  

Even with a more challenging 2023, our revenue remains well on track to grow between 15% and 20% CAGR [compound annual growth rate] over the next several years in U.S. dollar terms, which is a target we communicated back in January 2022 investor conference.

And third, though there's geopolitical uncertainty for this company, I believe the risks involved are being greatly overemphasized at this point. Yes, The People's Republic of China has been posturing more intensively about its desire to bring Taiwan under its control -- and is hinting that an invasion isn't totally out of the question. Such a war would be disastrous for the entire world. Should it happen, TSMC stock wouldn't be the only one to plummet. Global stock markets, not to mention the world economy, would be thrown into tumult -- mainland China's included. It's thus difficult for me to come to the conclusion that TSMC bears more geopolitical risk than other semiconductor and technology company stocks.  

Is TSMC a best buy now?

That last point being said, I still am not ready to open a position in TSMC. Given many companies' and governments' desire to diversify their sources of chip supply away from Taiwan, a great deal of investment is being made in building new fabrication facilities in the U.S., Europe, South Korea, Japan, and elsewhere. TSMC is participating in this. (It's constructing a fab in Arizona, though its planned opening date has been delayed into 2025.) However, my preferred way to participate in this trend lies with investments in fabrication equipment companies rather than the fabs themselves.

You see, as TSMC ramps up its new chipmaking capabilities and constructs new fabs, it will need to place lots of new orders with top manufacturing equipment suppliers like ASML Holding (ASML 2.04%) and Applied Materials (AMAT 2.98%). So will Samsung, Intel, and others as they build their own new plants. These heavy tech machinery makers -- think of them as the "picks and shovels" players for semiconductors, and thus for all things computing and power management technology -- will benefit a great deal from this wave of construction.

Nevertheless, keep TSMC on your radar. Its profitability is poised for a dip for the rest of 2023, but growth should pick up in earnest again by 2024. Shares today trade for a measly 16 times next year's expected earnings, which could be a real steal if its revenue quickly returns to double-digit percentage growth within the next few quarters.