The emergence of artificial intelligence (AI) caused a number of tech stocks to skyrocket over the past year, including Taiwan Semiconductor Manufacturing (TSM -1.20%). The company is a key enabler of AI, since it's a maker of computer processing chips used in AI systems.

As such, it's not surprising the firm's share price nearly doubled from a 52-week low of $81.21 last April to $158.40 in March. Does this outsized price gain mean you've missed the boat to buy?

Perhaps not. But before deciding to scoop up shares, it's important to assess whether Taiwan Semiconductor Manufacturing Company, popularly known as TSMC, is a worthwhile long-term investment.

TSMC's sudden stock decline

TSMC is the world's largest manufacturer of semiconductor chips. Its customers include AI chip giant Nvidia. These factors seem to position TSMC well for success in the AI era. But after TSMC announced its first-quarter results on April 18, the company's share price dropped.

The cause of the stock price decline was TSMC's downbeat outlook for the semiconductor market in 2024. The company is experiencing a seasonal dip in sales of its products for smartphones.

In addition, CFO Wendell Huang called out weak demand for its automotive business as a key factor for the company's market outlook. TSMC management previously expected this segment to grow in 2024, but now anticipates a decline. CEO C.C. Wei downplayed the lower forecast. He described an expectation for the market to "experience a more mild and gradual recovery in 2024."

Does TSMC's 2024 semiconductor outlook signal a concern? In the long run, no. That's because the industry is cyclical in nature. So up and down sales cycles are normal.

TSMC's financials

TSMC's ability to perform over the long run is what matters most. In this regard, the company is in an excellent position. TSMC expects 2024 revenue to increase by over 20% compared to 2023's $69.3 billion.

Demand for artificial intelligence hardware plays a key part in this revenue growth. TSMC estimates revenue from AI processors will more than double in 2024.

The company is on its way to meeting this year's sales goal. For the first quarter of 2024, its revenue reached $18.9 billion, or 592.6 billion in New Taiwan dollars, a 13% increase from 2023. For Q2, TSMC anticipates sales of at least $19.6 billion, up from $15.7 billion in the prior year.

Not only does TSMC benefit from the potent tailwind of AI demand, the company's financial health is solid. At the end of Q1, the firm's assets totaled NT$5.8 trillion compared to total liabilities of NT$2.1 trillion. It held NT$1.9 trillion in cash and marketable securities.

TSMC also generates impressive free cash flow (FCF). It exited Q1 with NT$255 billion in FCF compared to NT$83 billion in the prior year. FCF reflects the cash TSMC possesses to put toward investments in its business, repurchase shares, pay down debt, and fund its dividend. Seeing this metric grow is a positive sign.

Deciding on TSMC stock

Regarding its dividends, TSMC's policy is to pay 70% of its annual FCF toward the dividend, which currently yields over 1%. With Q1's strong FCF result, Huang stated he expects the dividend to increase.

TSMC also obtained $6.6 billion in federal funding as part of the CHIPS Act. This represents the biggest direct investment in a foreign company in U.S. history. The grant will be used to build semiconductor fabrication factories in Arizona.

TSMC is firing on all cylinders right now. It has the multiyear tailwind of AI, large customers such as Nvidia, and growing revenue and FCF.

Its recent drop in stock price creates a buying opportunity. In fact, the consensus among Wall Street analysts is a "buy" rating on TSMC shares with a median price target of $150.

Given the opportunities created by the rise of AI and its strong financials, TSMC is well positioned as a good long-term investment.