[llvm] Iterate SmallPtrSet in reverse order to uncover non-determinism in codegen
authorMandeep Singh Grang <mgrang@codeaurora.org>
Wed, 14 Dec 2016 00:15:57 +0000 (00:15 +0000)
committerMandeep Singh Grang <mgrang@codeaurora.org>
Wed, 14 Dec 2016 00:15:57 +0000 (00:15 +0000)
commitf6b069c7db5f86e73d997b212da8dfa5c32b822f
treed3472a6f8733ec93d980671e1ab7d68ccf16e801
parent30e304e2a646ccd5f34d5697cad0be9dcccfaa2d
[llvm] Iterate SmallPtrSet in reverse order to uncover non-determinism in codegen

Summary:
Given a flag (-mllvm -reverse-iterate) this patch will enable iteration of SmallPtrSet in reverse order.
The idea is to compile the same source with and without this flag and expect the code to not change.
If there is a difference in codegen then it would mean that the codegen is sensitive to the iteration order of SmallPtrSet.
This is enabled only with LLVM_ENABLE_ABI_BREAKING_CHECKS.

Reviewers: chandlerc, dexonsmith, mehdi_amini

Subscribers: mgorny, emaste, llvm-commits

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

llvm-svn: 289619
llvm/include/llvm/ADT/SmallPtrSet.h
llvm/lib/Support/CommandLine.cpp
llvm/unittests/ADT/CMakeLists.txt
llvm/unittests/ADT/ReverseIterationTest.cpp [new file with mode: 0644]