+1 to solving this. Not sure about the approach, but assuming the following concerns are addressed, I'm (+1) on it too:
This solution is clever! However, I think there is some difficulty to determining this ordering key. Namely, what happens when I construct the (Set Name) using results from multiple reifies?
One solution is to have the ordering key be a consecutive supply that's initialized on a per-module basis. There is still an issue there, though, which is that you might store one of these names in a global IORef that's used by a later TH splice. Or, similarly, serialize the names to a file and later load them. At least in those cases you need to use 'runIO' to break determinism.
If names get different ordering keys when reified from different modules (seems like they'd have to, particularly given ghc's "-j"), then we end up with an unpleasant circumstance where these do not compare as equal. How about having the Eq instance ignore the ordering key? I think that mostly resolves this concern. This implies that the Ord instance should also yield EQ and ignore the ordering key, when the unique key matches.
One issue with this is that switching the order of reify could unexpectedly vary the behavior.
Does the map in TcGblEnv imply that a reify from a later module will get the same ordering key? So does this mean that the keys used in a given reify depend on which things have already been reified? In that case, then this is also an issue with your solution. Now, it's not a big problem at all, just surprising to the user.
If the internal API for Name does change, may as well address
https://ghc.haskell.org/trac/ghc/ticket/10311 too. I agree with SPJ's suggested solution of having both the traditional package identifier and package keys in 'Name'.
-Michael