[LoopVectorize] Use SetVector to track uniform uses to prevent non-determinism.
authorHuihui Zhang <huihuiz@quicinc.com>
Wed, 31 Mar 2021 17:58:36 +0000 (10:58 -0700)
committerHuihui Zhang <huihuiz@quicinc.com>
Wed, 31 Mar 2021 18:21:07 +0000 (11:21 -0700)
commitfe5c4a06a49c697399323cc55e2135a5452ed616
tree1dd5fd30414555ddfe1e8e0ec35c2b2b882a5b7f
parent888c5067b4dce403774536a08f79d59865db3d12
[LoopVectorize] Use SetVector to track uniform uses to prevent non-determinism.

Use SetVector instead of SmallPtrSet to track values with uniform use. Doing this
can help avoid non-determinism caused by iterating over unordered containers.

This bug was found with reverse iteration turning on,
--extra-llvm-cmake-variables="-DLLVM_REVERSE_ITERATION=ON".
Failing LLVM test consecutive-ptr-uniforms.ll .

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D99549
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp