Fix PR4336: Iterating over use-def chains doesn't seem to be deterministic.
authorChris Lattner <sabre@nondot.org>
Tue, 16 Jun 2009 05:15:21 +0000 (05:15 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 16 Jun 2009 05:15:21 +0000 (05:15 +0000)
commit714fa95d01ce1a646b52bc529f3dbcf6a06fa29b
treedb917949ab045fa1f52f85561d39c97e04c4bb1c
parentfe7f294d5cb42bcb98f4d23b26e83b361175df38
Fix PR4336: Iterating over use-def chains doesn't seem to be deterministic.

The problem was that BitcodeReader::materializeModule would read functions
from the bc file in densemap pointer key order (doubly non-deterministic!),
which would cause the use-def chains to be set up for globals in
non-determinstic order.  Non-determinstic use/def chains can cause
nondeterminism in many places down-stream.

Many thanks to Julien Lerouge for putting together the pass in the PR that
shows the issue!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73470 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Bitcode/Reader/BitcodeReader.cpp