1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

llvm-uselistorder: Add -num-shuffles option

llvm-svn: 214144
This commit is contained in:
Duncan P. N. Exon Smith 2014-07-28 23:25:21 +00:00
parent 49df9214f3
commit 15c535b21b
2 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
; RUN: llvm-uselistorder < %s -preserve-bc-use-list-order
; RUN: llvm-uselistorder < %s -preserve-bc-use-list-order -num-shuffles=5
@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
@b = alias i1* getelementptr ([4 x i1]* @a, i64 0, i64 2)

View File

@ -43,6 +43,11 @@ static cl::opt<std::string> InputFilename(cl::Positional,
static cl::opt<bool> SaveTemps("save-temps", cl::desc("Save temp files"),
cl::init(false));
static cl::opt<unsigned>
NumShuffles("num-shuffles",
cl::desc("Number of times to shuffle and verify use-lists"),
cl::init(1));
namespace {
struct TempFile {
@ -370,13 +375,19 @@ int main(int argc, char **argv) {
return 0;
}
shuffleUseLists(*M);
for (unsigned I = 0, E = NumShuffles; I != E; ++I) {
DEBUG(dbgs() << "*** iteration: " << I << " ***\n");
// Shuffle with a different seed each time so that use-lists that aren't
// modified the first time are likely to be modified the next time.
shuffleUseLists(*M, I);
if (!verifyBitcodeUseListOrder(*M))
report_fatal_error("bitcode use-list order changed");
if (shouldPreserveAssemblyUseListOrder())
if (!verifyAssemblyUseListOrder(*M))
report_fatal_error("assembly use-list order changed");
}
return 0;
}