SAN FRANCISCO — Two days after Donald J. Trump won the 2016 election, executives at Google consoled their employees in an all-staff meeting broadcast around the world.

“There is a lot of fear within Google,” said Sundar Pichai, the company’s chief executive, according to a video of the meeting viewed by The New York Times. When asked by an employee if there was any silver lining to Mr. Trump’s election, the Google co-founder Sergey Brin said, “Boy, that’s a really tough one right now.” Ruth Porat, the finance chief, said Mr. Trump’s victory felt “like a ton of bricks dropped on my chest.” Then she instructed members of the audience to hug the person next to them.

Sixteen months later, Google’s parent company, Alphabet, has most likely saved billions of dollars in taxes on its overseas cash under a new tax law signed by Mr. Trump. Alphabet also stands to benefit from the Trump administration’s looser regulations for self-driving cars and delivery drones, as well as from proposed changes to the trade pact with Mexico and Canada that would limit Google’s liability for user content on its sites.

Once one of Mr. Trump’s most vocal opponents, Silicon Valley’s technology industry has increasingly found common ground with the White House. When Mr. Trump was elected, tech executives were largely up in arms over a leader who espoused policies on immigration and other issues that were antithetical to their companies’ values. Now, many of the industry’s executives are growing more comfortable with the president and how his economic agenda furthers their business interests, even as many of their employees continue to disagree with Mr. Trump on social issues.