Buying stocks of companies benefiting from long-term industry trends can help you identify rewarding investment opportunities. The following companies are serving growing demand in the semiconductor and software industries. Here's why Advanced Micro Devices (AMD 0.46%) and Constellation Software (CNSWF -0.39%) are two stocks I'd consider buying now and holding for the long term.

A rising stock chart above an hourglass.

Image source: Getty Images.

1. Advanced Micro Devices

Shares of Advanced Micro Devices look very attractive right now. The stock is down 50% from its previous high and trades at 29 times forward earnings estimates. This valuation seems too low for a company that just posted a 55% year-over-year increase in adjusted earnings in the first quarter.

AMD is the No. 2 supplier of graphics processing units (GPUs) behind Nvidia. Nvidia has led the GPU market for 20 years, but AMD is poised to gain back some market share as data center operators look for cost-effective chip solutions.

Data center revenue grew 57% year over year last quarter, but that's before AMD completed the acquisition of ZT Systems. This deal will allow AMD to supply data centers with rack-level AI computing systems combining AMD's GPUs, central processing units (CPUs), networking chips, and software. This should attract more business from top cloud providers that operate massive data centers.

Amazon disclosed a new stake in AMD stock worth $84 million in Q1. Amazon Web Services rolled out new AI workloads running on its Amazon Elastic Compute Cloud (EC2) in the first quarter. Amazon EC2 is using AMD's EPYC processors and Xilinx field-programmable gate arrays (FPGAs), which AMD acquired in 2022.

AMD reported on its Q1 earnings call that every major cloud provider is deep in development in integrating its EPYC Turin processors. This also points to more growth for its data center business.

While AMD faces competition from Nvidia and other semiconductor companies, Amazon's investment signals that AMD still has a valuable role to play in the chip supply chain. With AMD also gaining share against Intel in the PC market with its Ryzen CPUs, there are enough catalysts here to justify buying a position in the stock right now.

2. Constellation Software

Canada-based Constellation Software is one of the best-performing growth stocks that doesn't get much attention on Wall Street. The company has delivered impressive growth over the last decade operating in the vertical software industry. These are companies that focus on providing software products for niche markets like payment scheduling and recordkeeping. This is a large and growing industry, which has sent Constellation shares soaring over 200% in the last five years.

Most of the stock's return is the result of savvy deal-making by management. The company's growth strategy is similar to how Warren Buffett grew Berkshire Hathaway, in that Constellation takes the free cash flow from its current software businesses and allocates it to new acquisitions that grow revenue and generate more cash flows.

Constellation focuses on acquiring software companies with above-average growth, profitability, and excellent management. Once acquired, Constellation improves their performance, which increases returns for shareholders.

Vertical software is a good investment. Companies in this industry are well insulated from competition from big software providers like Microsoft. Constellation is focusing on businesses that sell niche software products that are tailored to each industry's needs. These are wide-moat companies that can grow for many years.

The results speak for themselves. Revenue and free cash flow have grown at a compound annual rate of about 20% over the last 10 years. The company's Q1 revenue grew 13% year over year, with free cash flow up 14%.

The vertical software industry is valued at over $150 billion and expected to grow at an annualized rate of 13%, according to Future Market Insights. This would bring the industry to over $500 billion by 2034. Constellation's annual revenue is just over $10 billion, indicating plenty of long-term upside for investors buying shares today.