Buying and holding great companies for the long run is a tried-and-tested way of making money in the stock market, as investors can not only benefit from secular growth opportunities by following this philosophy but also take advantage of the power of compounding.

Artificial intelligence (AI) has emerged as the next big growth opportunity for investors. Bloomberg estimates that the generative AI market, which was worth $40 billion in 2022, could generate a whopping $1.3 trillion of annual revenue in 2032. The AI market is set to clock a compound annual growth rate of 42% during this period.

As such, now would be a good time for investors to invest in companies that could gain a lot from this lucrative opportunity in the long run. Buying AI stocks as a part of a diversified portfolio could even help investors become millionaires. For instance, a $10,000 investment made in Nvidia -- a pioneer in AI hardware -- a decade ago is now worth $1.68 million.

Of course, expecting other AI stocks to replicate Nvidia's stunning gains isn't logical. However, buying shares of Taiwan Semiconductor Manufacturing (TSM 1.26%), popularly known as TSMC, and Super Micro Computer (SMCI 8.89%) with $10,000 in investible cash could be a smart long-term move.

Assuming you have $10,000 at your disposal after settling your bills, clearing expensive debt, and having saved enough for an emergency fund, putting that money into TSMC and Super Micro could help you construct a million-dollar portfolio. Let's see why.

1. Taiwan Semiconductor Manufacturing

The demand for semiconductors is booming thanks to AI. The global semiconductor market generated $315 billion in revenue in 2013, according to Gartner, a number that increased to $533 billion last year. So the global semiconductor market added $218 billion in revenue during the past decade. AI is set to drive much stronger growth for the global semiconductor market over the next decade.

Allied Market Research estimates that AI chip revenue could hit nearly $384 billion a year in 2032, posting a CAGR of 38%. TSMC gives investors a solid way to capitalize on this huge end-market opportunity. That's because the Taiwan-based company is the world's leading foundry, with an estimated market share of 58%, according to TrendForce. It enjoys a massive lead over second-place Samsung, which has a market share of just over 12%.

The foundry business model means TSMC manufactures chips for other companies. Its customers include  Apple, Nvidia, Broadcom, and Advanced Micro Devices, among others. The big surge in the demand for AI chips has started driving solid growth for TSMC. Sales of the company's advanced chips made on a 5-nanometer (nm) process node have gained impressive traction in recent quarters.

What's more, TSMC is now anticipating its 3nm process node, which will be deployed to make more powerful AI chips, to contribute $12.7 billion in revenue this year.

In December 2022, TSMC management said that its 3nm process node will be used by chipmakers to make end products worth $1.5 trillion within five years of starting volume production. Now that this process node is gaining traction and anticipated to account for 15% of TSMC's revenue this year, it seems set to move the needle in a bigger way for the company.

Not surprisingly, analysts are anticipating TSMC's bottom-line growth to jump significantly compared to last year's reading of $5.18 per share.

TSM EPS Estimates for Current Fiscal Year Chart

TSM EPS Estimates for Current Fiscal Year data by YCharts

If TSMC is able to achieve $8.90 per share in earnings in 2026 and trades at 31 times forward earnings at that time (using the Nasdaq-100's forward earnings multiple as a proxy for tech stocks), its share price could jump to $276. That points toward a 115% jump in three years, suggesting that TSMC could more than double investors' money.

But if you can continue to hold the stock for a much longer time, let's say 10 or 15 years, it could deliver much more upside and contribute nicely to a million-dollar portfolio.

2. Super Micro Computer

Super Micro Computer went public in 2007, and a $10,000 investment in the stock during its initial public offering (IPO) is now worth more than $970,000.

SMCI Chart

SMCI data by YCharts

The stock tripled in 2024 as AI has supercharged its growth. The company is expecting to finish its current fiscal year with revenue of $14.5 billion, a massive jump compared to the $7.1 billion revenue it generated in the preceding fiscal year. Super Micro's growth took off as its server solutions were being deployed for mounting AI chips. The good news is that Super Micro's end-market opportunity is set to expand significantly in the long run.

According to a third-party estimate, the global AI server market could generate $177 billion in annual revenue in 2032, up from $38 billion last year. Super Micro's full-year revenue forecast for fiscal 2024 suggests that it is at the beginning of a terrific growth curve, especially considering that it is expected to corner a bigger share of this market.

According to Barclays, the company was sitting on a 7% share of the overall server market last year. However, its efforts to bump its manufacturing capacity are expected to help it take share away from rivals. As such, it is easy to see why analysts are forecasting a 48% annual jump in the company's earnings for the next five years.

Based on its fiscal 2023 earnings of $11.81 per share, Super Micro's bottom line could increase to almost $84 per share after five years. Multiplying the projected earnings with the Nasdaq-100's forward earnings multiple of 31 could send its stock price to $2,600. That would be triple its current stock price.

Of course, the long-term opportunity in AI servers means that Super Micro could deliver even bigger gains over the next decade, which is why investors looking to build a million-dollar portfolio would do well to buy this AI stock with their investible cash.