On Tuesday, though, optimism mostly ruled.

Nvidia rose 1.8% and was one of the strongest forces driving the market higher ahead of its profit report coming on Wednesday. It’s the last to report this quarter among the “Magnificent Seven” Big Tech companies that have grown so large that their stock movements dominate the rest of the market.

Nvidia has been riding a tidal wave of growth created by the frenzy around artificial-intelligence technology, but it is also facing criticism that its stock price has shot too high.

Informatica climbed 5.6% after Salesforce said it would buy the AI-powered cloud data management company in an all-stock deal valuing it at about $8 billion. Salesforce slipped 0.4%.

AutoZone added 0.8% following a mixed report on its performance for the three months through May 10. Its profit fell short of analysts’ expectations, but its growth in revenue was stronger than expected. CEO Phil Daniele said shifting moves in foreign-currency markets put pressure on the retailer’s operations outside the United States.

The US dollar’s value has been jumping up and down against everything from the euro to the Mexican peso because of uncertainty around Trump’s trade policies. When the dollar weakens, it can mean each peso of sales made in Mexico may be worth fewer dollars.

In the bond market, Treasury yields eased to take some of the pressure off the stock market. The yield on the 10-year Treasury fell to 4.48% from 4.51% late Friday. It had been rising late last week, in part because of worries about the US government’s rapidly increasing debt.

Yields have been climbing for bond markets around the developed world, particularly in Japan, where a recent auction of longer-term bonds found relatively few buyers. Analysts said worries eased after Japan’s finance ministry sent a questionnaire to bond investors that they took as a signal of efforts to calm the market.

In stock markets abroad, European indexes rose, while Asian indexes were mixed.