The prospects for a 20 percent tax cut turbocharged the stock market Thursday as the Senate moved closer to a vote, but tech lagged behind the industrials, a group viewed as a big beneficiary. Goldman Sachs strategists say the proposed tax bills could boost aggregate S&P 500 earnings by 5 percentage points next year, but for tech, it could be a 3 percent decline.

There's a reason tech has been the worst performing sector this week as the tax bill makes its way through Congress — it's the sector that benefits the least.

The market has been focused on the potential that the repatriation of the billions of dollars technology companies have kept stashed overseas will bring a new round of stock buybacks and dividends. But the proposed changes in tax structure to a new territorial-based version ends loopholes used widely by tech and health-care companies to protect profits from the current high U.S. tax rate of 35 percent.

Goldman analysts recently put tech at "neutral weight" from overweight just because its tax bill will not see a big reduction, as some other industries will. Under the proposed plan, health care and tech will see the least gains.

"Tech has the lowest effective tax rate of any sector [24 percent] and would benefit least under the various proposals. The tax proposals target multinationals by trying to restrict "earnings stripping" and introducing a minimum tax on overseas revenues. Although Tech has the highest expected sales growth and profit margins, it also has the highest risk from tax reform, valuation, and government regulation," wrote Goldman analysts.

Goldman says the median S&P company pays an effective tax rate of 27 percent, compared with statutory rates of 39 percent, when including 4 percent for state and local taxes. S&P 500 companies repatriate less than 30 percent of their foreign income and pay only foreign taxes, which are lower than U.S. taxes on about 70 percent of their foreign profits.

For tech companies, 59 percent of their sales are overseas.

"As the dispersion of effective tax rates narrows, we estimate that tax reform will result in an effective tax rate slightly below 24 percent for the S&P 500, including federal, state, and local taxes," the Goldman analysts wrote. In a scenario where all sectors paid an effective 24 percent tax rate, "Info Tech EPS would decline by 3 percent compared with a 5 percent increase for the aggregate S&P 500."

The top 10 hoarders of overseas cash account for $675 billion, or about 75 percent of the S&P 500 companies' total foreign cash stash. The tech sector holds $633 billion of it. That cash would be repatriated at a lower one-time rate.

JPMorgan's quant strategists fired off a warning this week that growth and momentum names could be hit by a continued rotation on passage of tax reform or even just speculation about it.

"We think the market is underestimating the probability of tax reform passage; the potential performance risk to active managers with high exposure to growth/momentum could be significant in the near term. For managers overweight growth/momentum, taking a defensive approach to tax reform appears prudent," they said in a note.

They said shareholders should use protective strategies for stocks that have high hedge fund ownership such as Facebook, Micron, Adobe and Netflix, among others.

Goldman is overweighting financials and industrials, two sectors that could benefit from tax reform, but it's still positive on tech even though it views it as a neutral weight.

It said the technology sector should see revenue growth of 12 percent, compared with 7 percent for the S&P 500, and its 20 percent profit margins are twice those of the S&P as a whole. Goldman analysts note that the FAAMG stocks — Facebook, Amazon, Apple, Microsoft, and Google [Alphabet] — are trading at their historical average relative valuation, and tech as a whole is at a premium to the market on all metrics.

"In addition, momentum and growth — both currently captured within the Technology sector — are typically the best-performing factors in a late-cycle environment. A potential boost to buybacks from repatriated overseas earnings should also support sector returns," they wrote.

Oppenheimer CIO Krishna Memani sees the hit to tech shares as temporary. "Once we get through this period into the new year, they can continue to deliver," he said.

The S&P technology sector was down about 2 percent for the week but is still up 36 percent for the year.