diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
commit | 9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a (patch) | |
tree | b466a4817f79516eb1df8eae92bccf62ecc84003 /contrib/llvm/tools/bugpoint/ListReducer.h | |
parent | f09a28d1de99fda4f5517fb12670fc36552f4927 (diff) | |
parent | e194cd6d03d91631334d9d5e55b506036f423cc8 (diff) | |
download | FreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.zip FreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.tar.gz |
Update llvm to trunk r256633.
Diffstat (limited to 'contrib/llvm/tools/bugpoint/ListReducer.h')
-rw-r--r-- | contrib/llvm/tools/bugpoint/ListReducer.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/llvm/tools/bugpoint/ListReducer.h b/contrib/llvm/tools/bugpoint/ListReducer.h index a0bb570..f08bc97 100644 --- a/contrib/llvm/tools/bugpoint/ListReducer.h +++ b/contrib/llvm/tools/bugpoint/ListReducer.h @@ -75,6 +75,11 @@ struct ListReducer { // Maximal number of allowed splitting iterations, // before the elements are randomly shuffled. const unsigned MaxIterationsWithoutProgress = 3; + + // Maximal number of allowed single-element trim iterations. We add a + // threshhold here as single-element reductions may otherwise take a + // very long time to complete. + const unsigned MaxTrimIterationsWithoutBackJump = 3; bool ShufflingEnabled = true; Backjump: @@ -157,6 +162,7 @@ Backjump: if (TheList.size() > 2) { bool Changed = true; std::vector<ElTy> EmptyList; + unsigned TrimIterations = 0; while (Changed) { // Trimming loop. Changed = false; @@ -186,9 +192,9 @@ Backjump: if (!Error.empty()) return true; } - // This can take a long time if left uncontrolled. For now, don't - // iterate. - break; + if (TrimIterations >= MaxTrimIterationsWithoutBackJump) + break; + TrimIterations++; } } |