Last year was not easy for investors, with a sell-off highlighting the importance of holding stocks for the long term, no matter the market conditions.

For instance, shares of Advanced Micro Devices (AMD 3.16%) plunged 55% throughout 2022 amid PC market declines. Yet Wall Street has boosted the stock by 43% in 2023, growing bullish over the company's participation in high-growth industries like data centers and artificial intelligence (AI). As a result, those who sold last year will not have benefited from AMD's recent rally.

The company has a long history of rewarding patient investors with substantial growth, and its stock is up 824% in the last five years. It stumbled last year, but AMD's long-term outlook remains positive. Here's why the stock is a buy right now.

AMD's strength is its diversification 

AMD has grown into a tech powerhouse, best known for its consumer PC components such as its Ryzen central processing units (CPUs) and graphics processing units (GPUs). But the company also has booming segments in data centers and embedded products, and a promising outlook in AI.

Its position in multiple high-profit markets was the main driver behind its 44% increase in revenue to $23.6 billion in fiscal 2022, despite the economically challenging year.

Data centers are an increasingly lucrative business for AMD, with its hardware powering servers worldwide. The company launched its Genoa series of data center chips in November 2022, with Microsoft's Azure, Alphabet's Google Cloud, and Oracle already signed on as cloud computing clients. Considering AMD's data center revenue rose 64% last year, the success of new chips is promising for the segment's long-term outlook.

In 2022, AMD completed its acquisition of Xilinx, a company specializing in programmable chips for markets such as automaking, AI, aerospace, and defense. The purchase further diversifies the chipmaker, allowing it to operate in a number of new fields. Growth in the company's embedded segment last year was almost exclusively fueled by Xilinx, which boosted revenue by 1,750% year over year to $4.5 billion.

AMD's priority on diversification has fortified its business, as proven by its revenue growth throughout a market downturn last year. The company's pivot to less consumer-reliant businesses like data centers and embedded products will likely further safeguard its earnings and offer substantial gains over the long term. 

AMD is a better buy than its competition

The tech industry has long been known for its wealth of growth stocks. As a result, AMD's position as a better buy than its market competitors -- with the biggest being Nvidia (NVDA 6.98%) and Intel (INTC 1.11%) -- strengthens the argument for its stock. 

Regarding Nvidia, AMD's diversification comes back into play. Nvidia shares catapulted 84% year to date on the prospects of AI. However, its revenue still heavily relies on the consumer GPU market, with an 88% market share, compared to AMD's 8%. Consequently, Nvidia's 2022 revenue grew 0.2% year over year, a vastly lower figure than AMD's gain of over 40%.

Nvidia similarly has strong prospects in data centers and AI thanks to its GPUs, but AMD's positions in other markets and better performance under last year's economic strains make it a more reliable business. 

And the success of AMD's Ryzen CPUs since their launch in 2017 has led it to consistently steal market share from Intel. From the fourth quarter of 2016 to the fourth quarter of 2022, AMD's CPU market share has grown from 17.8% to 35.2%, with Intel's share falling from 82.2% to 62.8%.

The companies also released competing data center chips between November 2022 and January 2023, with benchmarks showing that AMD's Genoa series outperforms Intel's Sapphire Rapids line in general-purpose workloads, according to Bernstein analyst Stacy Rasgon.

When considering forward price-to-earnings (P/E) ratios, AMD once again comes out on top compared to Nvidia and Intel. AMD's stock currently offers the best value next to its two biggest competitors. 

INTC PE Ratio (Forward) Chart

Data by YCharts.

AMD has a dominating presence in tech and is seemingly growing stronger by the year, and analysts are taking notice. On March 30, Wells Fargo upgraded its price target for AMD from $85 to $120 -- 32% growth from its current price. The company has a history of stellar growth, with its expanding positions in multiple areas of tech likely to keep it flourishing for decades. As a result, AMD's stock is a no-brainer buy right now.