Make the Ord Module independent of Unique order (2nd try)
authorBartosz Nitka <niteria@gmail.com>
Thu, 9 Jun 2016 15:50:32 +0000 (08:50 -0700)
committerBartosz Nitka <niteria@gmail.com>
Mon, 25 Jul 2016 14:44:00 +0000 (07:44 -0700)
commitdaa058e080936a7a764ffdf0b70deb85faae9044
tree865f24a28ee03aa75c0ddc6b6685381cc89195e4
parentbab927c9f0cb094a3e59d46372125dfe2bf514bf
Make the Ord Module independent of Unique order (2nd try)

The `Ord Module` instance currently uses `Unique`s for comparison.
We don't want to use the `Unique` order because it can introduce
nondeterminism.
This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic
ordering making `Ord Module` deterministic transitively.

I've run `nofib` and it doesn't make a measurable difference.

See also Note [ModuleEnv determinism and performance].

This fixes #12191 - the regression, that the previous version of this
patch had.

Test Plan:
./validate
run nofib: P112

Reviewers: simonmar, bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2354

GHC Trac Issues: #4012, #12191

(cherry picked from commit 348f2dbb835b1208f601bb1e8daa1d1d54507eda)
compiler/basicTypes/Module.hs
compiler/typecheck/FamInst.hs
testsuite/tests/driver/sigof01/all.T
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.stderr
testsuite/tests/rename/should_fail/T11071.stderr
testsuite/tests/rename/should_fail/T11071a.stderr
testsuite/tests/typecheck/should_fail/T6018fail.stderr