Rename atomicReadMVar and friends to readMVar.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This reverts commit 163de25813d12764aa5ded1666af7c06fee0d67e and commit 279ac9f66a83203448b279ea478b2cc1dafbd35d.
adding FastString.string_table to the sharedCAF/Globals.c mechanism
Update docs for readMVar/tryReadMVar.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Add support for byte endian swapping for Word 16/32/64.

  * Exposes bSwap{,16,32,64}# primops
  * Add a new machop: MO_BSwap
  * Use a Stg implementation (hs_bswap{16,32,64}) for other implementation
    in NCG.
  * Generate bswap in X86 NCG for 32 and 64 bits, and for 16 bits, bswap+shr
    instead of using xchg.
  * Generate llvm.bswap intrinsics in llvm codegen.

Authored-by: Vincent Hanquez <tab@snarc.org>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Fix bug in readMVar implementation: keep clean MVars clean.

The readMVar implementation had only partially implemented
a micro-optimization which allows us to avoid adding an MVar
to the mutable list if the MVar was not changed.  However,
this was not applied to the release method on the fast path,
resulting in dirty MVars which were not added to the mutable list.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Sync the list of default warnings with reality; fixes #8060.
On second thoughts, don't document -fwarn-alternative-layout-rule-transitional

I think the alternative layout rule flags are deliberately not
documented at the moment.
Document -fwarn-pointless-pragmas; fixes #8049
Add `:show linker` command to `:help` output
Add `:show imports` to completion table
use prompt2 in `:set +m` mode
Add final remaining bits to fix #7978.
Temporarily disable common block elimination; fixes #8083 for now
Fix a bug in stack layout with safe foreign calls (#8083)

We weren't properly tracking the number of stack arguments in the
continuation of a foreign call.  It happened to work when the
continuation was not a join point, but when it was a join point we
were using the wrong amount of stack fixup.
Binary: Make lazyGet more thread-safe

All values read lazily from the same BinHandle share the same mutable
offset variable (_off_r). If two such lazy values are simultaneously
evaluated, the two threads will step over each other when writing to
_off_r.

Fortunately, for BinMem handles, making lazyGet thread-safe is simple:
just use a fresh off_r variable when deferring the call to getAt.

For BinIO handles, a race condition still exists because IO handles
contain their own mutable file pointer variable that gets clobbered in a
similar way that _off_r would. But GHC doesn't use BinIO handles anywhere
so this particular issue could be ignored for now.
TcRnMonad: Make newUnique and newUniqueSupply thread-safe

These functions are used inside a forkM'd action during the lazy
interface-file typechecking. We have to update the UniqSupply in an
atomic fashion if multiple such actions are executed concurrently.

Also remove a stale comment that alluded to using a now-commonplace
method for splitting a UniqSupply.
TidyPgm: Atomically update the name cache in tidyTopName

To pave the way for parallel --make, we need to make sure that all
modifications of shared mutable state are performed in a thread-safe
manner. This is one of such occurrences.
SysTools: Make cleanTempFiles/cleanTempDirs thread-safe

Atomically update the list of files to clean so that multiple threads
won't step over each other during cleanup.
SysTools: Make newTempName and getTempDir thread-safe

Concurrent calls to findTempName could return the same file name, and
concurrent calls to getTempDir could return different directories.