diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-08 04:02:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-08 04:02:47 +0000 |
commit | 70ef449741da8b1ef035e04a55958652a0200ba1 (patch) | |
tree | 5076fe2492725480299ed59fe3199de3e5ef892d /tools/bugpoint/Miscompilation.cpp | |
parent | 28ea4f6c070f3d7eb75291a64cf75f1e7af6eadf (diff) | |
download | llvm-70ef449741da8b1ef035e04a55958652a0200ba1.tar.gz llvm-70ef449741da8b1ef035e04a55958652a0200ba1.tar.bz2 llvm-70ef449741da8b1ef035e04a55958652a0200ba1.tar.xz |
Generalize bugpoint's concept of a "safe" backend, and add options
to allow the "safe" backend to be run with a different path, and/or
with different command-line options.
This enables the following use cases:
- bugpoint llc against an llc command from a different build
- bugpoint llc against the same llc with different command-line options
- and more...
Also, document the existing "custom" interpreter options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index d57e52b10b..6a0911bfb5 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -277,7 +277,7 @@ static bool ExtractLoops(BugDriver &BD, // we're going to test the newly loop extracted program to make sure nothing // has broken. If something broke, then we'll inform the user and stop // extraction. - AbstractInterpreter *AI = BD.switchToCBE(); + AbstractInterpreter *AI = BD.switchToSafeInterpreter(); if (TestMergedProgram(BD, ToOptimizeLoopExtracted, ToNotOptimize, false)) { BD.switchToInterpreter(AI); @@ -838,13 +838,15 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { /// debugCodeGenerator - debug errors in LLC, LLI, or CBE. /// bool BugDriver::debugCodeGenerator() { - if ((void*)cbe == (void*)Interpreter) { - std::string Result = executeProgramWithCBE("bugpoint.cbe.out"); - std::cout << "\n*** The C backend cannot match the reference diff, but it " - << "is used as the\n 'known good' code generator, so I can't" - << " debug it. Perhaps you have a\n front-end problem? As a" - << " sanity check, I left the result of executing the\n " - << "program with the C backend in this file for you: '" + if ((void*)SafeInterpreter == (void*)Interpreter) { + std::string Result = executeProgramSafely("bugpoint.safe.out"); + std::cout << "\n*** The \"safe\" i.e. 'known good' backend cannot match " + << "the reference diff. This may be due to a\n front-end " + << "bug or a bug in the original program, but this can also " + << "happen if bugpoint isn't running the program with the " + << "right flags or input.\n I left the result of executing " + << "the program with the \"safe\" backend in this file for " + << "you: '" << Result << "'.\n"; return true; } |