Warren Buffett’s Berkshire Hathaway Inc. trimmed its investments in Goldman Sachs Group Inc. and Wal-Mart Stores Inc. as the billionaire freed up cash ahead of the completion of one of his largest acquisitions.

Berkshire had about 11 million shares of Goldman Sachs as of Sept. 30, compared with 12.6 million three months earlier, according to a filing Monday disclosing holdings as of the end of the third quarter. The stake in Wal-Mart dropped to 56.2 million shares from 60.4 million. The retailer is headed for its fourth-straight quarterly decline in New York trading.

Buffett agreed in August to buy aerospace-equipment maker Precision Castparts Corp. for more than $30 billion. Standard & Poor’s is reviewing whether to cut Berkshire’s credit rating amid an examination of how Buffett will finance the transaction, which the companies expect to be completed in 2016. The billionaire told CNBC that he sold some stocks to help pay for the deal, according to a Twitter post from the business news station.

‘Less Confidence’

“This might indicate Warren Buffett has less confidence in GS and WMT, as compared to his other holdings,” David Kass, a professor at the University of Maryland’s Robert H. Smith School of Business, said in an e-mail, using the companies’ ticker symbols. “I am not surprised about the reduction in WMT as its outlook is not good for the next two years at least.”

The biggest additions in the third quarter were previously disclosed: Berkshire announced in August a major increase in its Phillips 66 stake, and Buffett’s company is the top holder of Kraft Heinz Co. While Buffett booked a $4.4 billion gain tied to the combination of Kraft and Heinz in the quarter, some of his other large holdings have tumbled, causing Berkshire to rack up rare paper losses.

‘Rough Time’

“Kraft Heinz has done great,” but several of Berkshire’s other major stock picks “have had a really rough time,” Meyer Shields, an analyst at Keefe Bruyette & Woods, said in a phone interview before the report was released.

One of the recent laggards, American Express Co., still trades well above the average price Berkshire paid for the shares. Wal-Mart is closer to break-even. But a third, International Business Machines Corp., is a different story.

Unrealized losses on Berkshire’s stake in IBM widened to $2 billion as of Sept. 30, or about 15 percent of what Buffett paid. Still, he said in a quarterly filing on Nov. 6 that he has no plan to exit the holding and expects shares to recover. Berkshire disclosed Monday that it added more than 1 million IBM shares in the third quarter.