summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-05-12 16:08:01 +0000
committerChris Lattner <sabre@nondot.org>2004-05-12 16:08:01 +0000
commit68bee938e539d884ee89ce4dfebbad777896960e (patch)
tree9c0983b352cd67ed8812f10e49bbe9c2996595c3 /tools/bugpoint
parentd99e1d3afbe664694ee04a5db5e4a7a8104858a1 (diff)
downloadllvm-68bee938e539d884ee89ce4dfebbad777896960e.tar.gz
llvm-68bee938e539d884ee89ce4dfebbad777896960e.tar.bz2
llvm-68bee938e539d884ee89ce4dfebbad777896960e.tar.xz
Check to see if all blocks are extractible first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/Miscompilation.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 4c957ac480..f17bfaa64a 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -354,11 +354,15 @@ namespace {
bool ReduceMiscompiledBlocks::TestFuncs(const std::vector<BasicBlock*> &BBs) {
// Test to see if the function is misoptimized if we ONLY run it on the
// functions listed in Funcs.
- std::cout << "Checking to see if the program is misoptimized when all but "
- << "these " << BBs.size() << " blocks are extracted: ";
- for (unsigned i = 0, e = BBs.size() < 10 ? BBs.size() : 10; i != e; ++i)
- std::cout << BBs[i]->getName() << " ";
- if (BBs.size() > 10) std::cout << "...";
+ std::cout << "Checking to see if the program is misoptimized when all ";
+ if (!BBs.empty()) {
+ std::cout << "but these " << BBs.size() << " blocks are extracted: ";
+ for (unsigned i = 0, e = BBs.size() < 10 ? BBs.size() : 10; i != e; ++i)
+ std::cout << BBs[i]->getName() << " ";
+ if (BBs.size() > 10) std::cout << "...";
+ } else {
+ std::cout << "blocks are extracted.";
+ }
std::cout << "\n";
// Split the module into the two halves of the program we want.
@@ -399,9 +403,16 @@ static bool ExtractBlocks(BugDriver &BD,
// obscuring the bug. The Blocks list will end up containing blocks that must
// be retained from the original program.
unsigned OldSize = Blocks.size();
- ReduceMiscompiledBlocks(BD, TestFn, MiscompiledFunctions).reduceList(Blocks);
- if (Blocks.size() == OldSize)
- return false;
+
+ // Check to see if all blocks are extractible first.
+ if (ReduceMiscompiledBlocks(BD, TestFn,
+ MiscompiledFunctions).TestFuncs(std::vector<BasicBlock*>())) {
+ Blocks.clear();
+ } else {
+ ReduceMiscompiledBlocks(BD, TestFn,MiscompiledFunctions).reduceList(Blocks);
+ if (Blocks.size() == OldSize)
+ return false;
+ }
Module *ProgClone = CloneModule(BD.getProgram());
Module *ToExtract = SplitFunctionsOutOfModule(ProgClone,