The question is a bit confusing. What type of upgrade are you purchasing at ticketing?
If you are depending on the elite Y/B/M-Up benefit then would be on a Y/B/M class fare. If you are using miles or an instrument then the fare basis could vary.
But the easy answer is that you get miles based on the original fare purchased, not based on the upgrade.