Fix non-determinism in Reassociate caused by address coincidences
authorDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 22 Mar 2019 20:16:35 +0000 (20:16 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 22 Mar 2019 20:16:35 +0000 (20:16 +0000)
commitef8761fd3b0f0b24b7e9347ad4ae686fc9ed8f94
tree0419f137c9865eafa74c4210d671562c1f87af1e
parent462446fd9a5d85458f1c61de353ce679ff5dbf9b
Fix non-determinism in Reassociate caused by address coincidences

Summary:
Between building the pair map and querying it there are a few places that
erase and create Values. It's rare but the address of these newly created
Values is occasionally the same as a just-erased Value that we already
have in the pair map. These coincidences should be accounted for to avoid
non-determinism.

Thanks to Roman Tereshin for the test case.

Reviewers: rtereshin, bogner

Reviewed By: rtereshin

Subscribers: mgrang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59401

llvm-svn: 356803
llvm/include/llvm/Transforms/Scalar/Reassociate.h
llvm/lib/Transforms/Scalar/Reassociate.cpp
llvm/test/Transforms/Reassociate/pointer-collision-non-determinism.ll [new file with mode: 0644]