The above button links to Coinbase. Yahoo Finance is not a broker-dealer or investment adviser and does not offer securities or cryptocurrencies for sale or facilitate trading. Coinbase pays us for certain activity generated through this link. Prices displayed are informational.

By Niket Nishant

May 19 (Reuters) - Shares of several U.S. software stocks gained on Tuesday, as the industry attempts a comeback after being battered for much of ‌the year on fears of disruption from artificial intelligence.

The beleaguered sector's rebound coincided ‌with a slide in chipmakers, which began to cool off following a blistering rally that took the Philadelphia ​SE Semiconductor Index to a record high earlier this month.

The iShares Expanded Tech-Software Sector ETF hit its highest level since January before paring gains, while Workday, ServiceNow and Salesforce rose between 1.4% and 2.4%.

Cybersecurity firms CrowdStrike, Okta, SailPoint and Zscaler gained between 1% and 2.6%. The Amplify ‌Cybersecurity ETF touched an all-time ⁠high and was last up 0.6%.

The gains hint at a possible shift in investor sentiment as markets reassess software stocks following a painful valuation ⁠reset.

"We continue to see some very attractive investments in software for those investors who can afford to be somewhat patient," said Gregg Moskowitz, senior enterprise software analyst at Mizuho.

A sustained rebound would ​suggest that ​markets are becoming more selective, distinguishing between companies ​genuinely at risk of being disrupted ‌by AI and those that could ultimately benefit through higher productivity, new products and stronger customer demand.

The divergence was on display on Monday, with analysts at BofA Global Research giving ServiceNow a "buy" rating, while reinstating Salesforce with an "underperform."

ServiceNow is "difficult to challenge" because it is "too entrenched" in large enterprise workflows, they said. Salesforce, however, faces what the analysts called "a structural shift ‌that permanently impairs Salesforce's business model."

"The market is drawing ​a clear line between companies that rely heavily on ​traditional per-seat subscriptions and those positioned ​closer to the center of the AI buildout," said Anthony Saglimbene, ‌chief market strategist at Ameriprise Financial.

Still, the ​rally may need to ​extend further to convince skeptics. Investors are likely to demand clearer evidence that software companies can defend their profit margins and business models from the competitive threat posed ​by AI.

The iShares Expanded Tech-Software ‌Sector ETF has lost 12.2% so far this year as of Monday's close. ​The S&P 500 software and services index is also down 13.7%.

(Reporting by ​Niket Nishant in Bengaluru; Editing by Tasim Zahid)