[IPO][SampleContextTracker] Use SmallVector to track context profiles to prevent...
authorHuihui Zhang <huihuiz@quicinc.com>
Mon, 29 Mar 2021 23:37:01 +0000 (16:37 -0700)
committerHuihui Zhang <huihuiz@quicinc.com>
Mon, 29 Mar 2021 23:37:10 +0000 (16:37 -0700)
commitca721042f1c9876eb350da22d1fda44626d2783b
tree9dc1a204df1bf55742b142ea45539b4485e9e96b
parent247ff26a89673886c20a3199c4aa0614b1b5c45d
[IPO][SampleContextTracker] Use SmallVector to track context profiles to prevent non-determinism.

Use SmallVector instead of SmallSet to track the context profiles mapped. 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 profile-context-tracker-debug.ll .

Reviewed By: MaskRay, wenlei

Differential Revision: https://reviews.llvm.org/D99547
llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
llvm/lib/Transforms/IPO/SampleContextTracker.cpp