When You get a a exotic weapon and give it to xur to upgrade,What does it do to the gun?I got my invective and gave it to xur and for me it just looks like it reset the upgrade progress.
If you got an exotic before the DLC dropped, it will have the original stats. When the DLC dropped, most exotics got a damage upgrade. If you got an exotic, you got it with the upgrade. However exotics obtained before the DLC dropped still kept the original damage, and must be upgraded to the new damage cap. It will reset the progress, but it will end up a better gun. The same applies to armour.
Exotics weapons from before the expansion capped out at 300 (aside from the Vex Mythoclast which was 323). Exotic armor capped out at 30 light prior to the expansion.
Taking an exotic weapon to Xur and paying the 7000-ish glimmer and an exotic shard will replace your current item with the upgrade one. This is only useful when using a pre expansion exotic. Weapons will be capped at 331, and armor will be light capped at 36. The special traits will not change.
Upgrading expansion gear will not raise its cap, as it already caps at 331 for weapons, and 36 light for armor. However, as pointed out by some in comments below, rerolling the armor through the upgrade facility can be useful if you wish to maximize the stats on your armor.