[ObjC][ARC] Fix non-deterministic behavior in ProvenanceAnalysis
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 11 May 2023 20:40:43 +0000 (13:40 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 11 May 2023 20:40:43 +0000 (13:40 -0700)
commit2895c4c00ff66420a2232f3fcfc341eb7b72ce67
treefcf35aee7c0ac0dafe0b381d2465521aaa46aee1
parent1585ee1077930d4a906b3265bb40a90ba4758c99
[ObjC][ARC] Fix non-deterministic behavior in ProvenanceAnalysis

Stop reordering the pointers passed in ProvenanceAnalysis::related based
on their values. That was causing non-determinism as the call to
relatedCheck(A, B) isn't guaranteed to return the same result as
relatedCheck(B, A).

Revert the following three commits (except the original test case in
related-check.ll):

665e47777df17db406c698d57b4f3c28d67c432e
295861514e0d1e48df2918b630dd692ac27ee0de
d877e3fe71676b0ff10410d80456b35cdd5bf796

These changes shouldn't be necessary once the call to std::swap is
removed.

Differential Revision: https://reviews.llvm.org/D150296
llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp
llvm/test/Transforms/ObjCARC/related-check.ll