diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-04-24 19:32:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-04-24 19:32:42 +0000 |
| commit | b052843bd2fc886de3424e2b2ddb5936452ce37d (patch) | |
| tree | d4f4642abba38d17acb00f4cdc9e415b467749cf | |
| parent | d571e2aa9175ff04d04d361e984781348c452f3a (diff) | |
| download | bcm5719-llvm-b052843bd2fc886de3424e2b2ddb5936452ce37d.tar.gz bcm5719-llvm-b052843bd2fc886de3424e2b2ddb5936452ce37d.zip | |
Allow bugpoint to try new an different methods for pruning down lists
llvm-svn: 5905
| -rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index d382c06c834..4960b8205de 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -72,6 +72,30 @@ struct ListReducer { break; } } + + // Okay, we trimmed as much off the top and the bottom of the list as we + // could. If there is more two elements in the list, try deleting interior + // elements and testing that. + // + if (TheList.size() > 2) { + bool Changed = true; + std::vector<ElTy> EmptyList; + while (Changed) { + Changed = false; + std::vector<ElTy> TrimmedList; + for (unsigned i = 1; i < TheList.size()-1; ++i) { // Check interior elts + std::vector<ElTy> TestList(TheList); + TestList.erase(TestList.begin()+i); + + if (doTest(EmptyList, TestList) == KeepSuffix) { + // We can trim down the list! + TheList.swap(TestList); + --i; // Don't skip an element of the list + Changed = true; + } + } + } + } } }; @@ -187,7 +211,7 @@ public: const std::vector<Function*> &Kept) { if (TestFuncs(Kept, false)) return KeepSuffix; - if (TestFuncs(Prefix, false)) + if (!Prefix.empty() && TestFuncs(Prefix, false)) return KeepPrefix; return NoFailure; } |

