It depends on the company and I would bet my life’s savings that if a discrepancy exists at Google, it is not intentional. I have many American friends, friends on TN visas, and friends on H1Bs and we are transparent about our pay (to protect each other from poor business practices). Being involved in the process there are so many legal barriers and red tape and people take it all seriously.
H1B holders will get paid less over time due to not being able to leave companies at the drop of a hat. A similar but less significant effect holds for TN visas. I have not once seen any significant pay discrepancy for two comparable software engineers at the same company based on visa status.