Page MenuHomePhabricator

[IPO][SampleContextTracker] Use SmallVector to track context profiles to prevent non-determinism.
ClosedPublic

Authored by huihuiz on Mon, Mar 29, 3:41 PM.

Details

Summary

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 .

Diff Detail

Event Timeline

huihuiz created this revision.Mon, Mar 29, 3:41 PM
huihuiz requested review of this revision.Mon, Mar 29, 3:41 PM
wenlei accepted this revision.Mon, Mar 29, 4:06 PM

LGTM, thanks for the fix. I used SmallSet initially, but the need for set went away later.

This revision is now accepted and ready to land.Mon, Mar 29, 4:06 PM

Thank you for the review! @wenlei , could you also help take a look at D99544 and D99549. They are in a similar vein. Thanks a lot!

MaskRay accepted this revision.Mon, Mar 29, 4:27 PM