Billionaire hedge fund manager Stanley Druckenmiller, who runs the Duquesne Family Office, made a number of interesting portfolio moves during the second quarter. Among them, the firm sold some of its Sandisk ( SNDK -0.28% ) stock and piled into three other AI-related companies: Taiwan Semiconductor ( TSM +0.71% ) , Alphabet ( GOOG +1.05% ) ( GOOGL +1.22% ) , and Amazon ( AMZN -0.57% ) .

Given how strong a year memory maker Sandisk was having in the first half, this move seemed prudent, as there were other, more attractive investment options available. And even though Druckenmiller made these moves at least a month and a half ago, this trio of stocks he bought would still be smart to load up on.

Was selling Sandisk a good idea?

We know about Druckenmiller's investing activities because no later than 45 days into every quarter, any fund that manages more than $100 million in assets has to file a Form 13-F with the SEC. That form details the fund's holdings as of the end of the prior quarter. This gives the public a snapshot of how these funds' portfolios are changing from quarter to quarter.

If you're looking at a fund that trades frequently in and out of positions from day to day or week to week, then this information is useless. However, when you're looking at the portfolios of fund managers who take a longer-term approach, it can be a useful tool.

Druckenmiller is one of the more successful long-term investors that I follow, and his fund reducing its Sandisk stake in Q2 makes a ton of sense, because the stock went on a major run to start the year. Taking some gains off the table after such a run-up is a prudent investing move.

NASDAQ : SNDK

However, the minor trim to his Sandisk position was outweighed by the amount he deployed to load up on shares of Taiwan Semiconductor, Alphabet, and Amazon, and those buys are what investors should be more focused on.

These three are no-brainer winners in the AI arms race

Taiwan Semiconductor, Alphabet, and Amazon all have one thing in common: They are clear winners from the AI infrastructure build-out. Taiwan Semiconductor is the most obvious, as more AI computing will require more chips. Taiwan Semiconductor is the largest logic chip producer on Earth by a wide margin, and as long as there is increased AI spending, TSMC will continue to be a winning investment. Druckenmiller increased the fund's stake in TSMC by 19% in Q2, making it Duquesne's second-largest holding.

NYSE : TSM

Amazon and Alphabet are in similar boats, even if their primary businesses are different. From an AI standpoint, they are both benefiting from the AI arms race via their cloud computing divisions , which are helping meet the huge demand for processing power to run AI workloads. Both plan to spend at least $200 billion on capital expenditures this year , primarily to build and equip new data centers. That's a ton of money being invested, and it shows how much computing demand there is. As these two hyperscalers bring more computing power online, their cloud revenues will expand, allowing them to post rapid growth with high profitability.

NASDAQ : AMZN

That makes Amazon and Alphabet smart stocks to invest in now, because the growth that will derive from their massive investments this year (and next year as well) hasn't started impacting their finances yet. Druckenmiller knows this, which explains why he dramatically increased his firm's Amazon stake in Q2. It now occupies a nearly 3% position in its portfolio. Alphabet was a new addition to the Duquesne Family Office portfolio, and makes up a slightly smaller position at 2.75%.

Given that the bulk of the effects from the latest round of AI build-outs are still not being felt by these three, they have plenty more room for upside.