summaryrefslogtreecommitdiff
path: root/tools/bugpoint/Miscompilation.cpp
Commit message (Collapse)AuthorAge
* [cleanup] Move the Dominators.h and Verifier.h headers into the IRChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199082 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix invalid function pointers in bugpoint ExtractLoopsHal Finkel2013-08-02
| | | | | | | | | | | | | | | | | | | | | | | The ExtractLoops function tries to reduce the failing test case by extracting one or more loops from the misoptimized piece of the program. In doing this, ExtractLoops must keep the MiscompiledFunctions vector up-to-date by ensuring that the pointers refer to functions in the current failing program. Unfortunately, this is not trivial because: - ExtractLoops is iterative, and there are several early exits (and the MiscompiledFunctions vector must be consistent with the current program at every non-fatal exit point). - Several of the utility functions used by ExtractLoops (such as TestOptimizer, some of which are called through the TestFn callback parameter, and Linker::LinkModules) delete their inputs upon success. This change adds several updates of the MiscompiledFunctions vector at different points. The first is after the initial call to TestMergedProgram which checks that the loop-extracted program still works. The second is after the call to TestFn (TestOptimizer, for example). This function will delete its inputs (which is why the existing ExtractLoops logic cloned the inputs first). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187674 91177308-0d34-0410-b5e6-96231b3b80d8
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185719 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1.h in tools/bugpoint/Miscompilation.cpp.Rafael Espindola2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184193 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert two uses of eraseFromDisk.Rafael Espindola2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184136 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1.h in ToolRunner.h.Rafael Espindola2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184107 91177308-0d34-0410-b5e6-96231b3b80d8
* Use only explicit bool conversion operatorsDavid Blaikie2013-05-15
| | | | | | | | | | | | | | | | | | | | | | | BitVector/SmallBitVector::reference::operator bool remain implicit since they model more exactly a bool, rather than something else that can be boolean tested. The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. One behavior change (YAMLParser) was made, though no test case is included as I'm not sure how to reach that code path. Essentially any comparison of llvm::yaml::document_iterators would be invalid if neither iterator was at the end. This helped uncover a couple of bugs in Clang - test cases provided for those in a separate commit along with similar changes to `operator bool` instances in Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181868 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-05
| | | | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert Chris' commits up to r149348 that started causing VMCoreTests unit ↵Argyrios Kyrtzidis2012-02-01
| | | | | | | | | | | | | | | | | | | test to fail. These are: r149348 r149351 r149352 r149354 r149356 r149357 r149361 r149362 r149364 r149365 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the "string" form of ConstantArray::get, usingChris Lattner2012-01-31
| | | | | | | ConstantDataArray::getString instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149365 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to use the linker without destroying the source module. ↵Tanya Lattner2011-10-11
| | | | | | | | | | | | | | | This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before. This line, and those below, will be ignored-- M include/llvm/Linker.h M tools/bugpoint/Miscompilation.cpp M tools/bugpoint/BugDriver.cpp M tools/llvm-link/llvm-link.cpp M lib/Linker/LinkModules.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141606 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugpoint fallout from the new type system.Nick Lewycky2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137467 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-21
| | | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugpoint support for miscompilations that result in a crash.Andrew Trick2011-05-11
| | | | | | | | | | This change allows bugpoint to pinpoint the "opt" pass and bitcode segment responsible for a crash caused by miscompilation. At least it works well for me now, without having to create any custom execution wrappers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131186 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace.Michael J. Spencer2011-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128631 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch FileRemover from PathV1 to V2.Michael J. Spencer2011-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128630 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-30
| | | | | | PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
* Most of bugpoint now only needs to know the pass names.Rafael Espindola2010-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110534 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EmitProgressBitcode const and add a Module argument to runPasses. UseRafael Espindola2010-08-05
| | | | | | that argument to simplify runPassesOn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110291 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const to some methods and change TestMergedProgram to return the mergedRafael Espindola2010-07-31
| | | | | | module and take a const BugDriver. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109951 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Program argument to diffProgram to avoid a use of swapProgramIn.Rafael Espindola2010-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109859 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the test while reducing blocks functional. This avoids accessing freedRafael Espindola2010-07-29
| | | | | | memory when one of the original BB is destroyed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109747 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of abusing swapProgramIn, just add a Module argument toRafael Espindola2010-07-28
| | | | | | EmitProgressBitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109602 91177308-0d34-0410-b5e6-96231b3b80d8
* Clone and restore the module being reduced inRafael Espindola2010-07-26
| | | | | | | | | | | ReduceMiscompilingFunctions::TestFuncs. This makes the test functional (i.e., no side effects). Before we would end up using dead functions if a pass decided to remove them (inline for example) and we would also keep broken functions and conclude that that a single function was enough to reproduce the bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109387 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r108813, in an attempt to get the self-host buildbots ↵Owen Anderson2010-07-20
| | | | | | | | | working again. I don't see why this patch would cause them to fail the way they are, but none of the other intervening patches seem likely either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108818 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r108794, a fix for the failing test from last time.Owen Anderson2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108813 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r108794, "Separate PassInfo into two classes: a constructor-freeDaniel Dunbar2010-07-20
| | | | | | | superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is breaking teh everything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108805 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate PassInfo into two classes: a constructor-free superclass ↵Owen Anderson2010-07-20
| | | | | | (StaticPassInfo) and a constructor-ful subclass (PassInfo). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108794 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ValueMap instead of DenseMap.Devang Patel2010-06-24
| | | | | | | The ValueMapper used by various cloning utility maps MDNodes also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106706 91177308-0d34-0410-b5e6-96231b3b80d8
* Save more temps with -save-temps.Rafael Espindola2010-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106409 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ->isVoidTy().Dan Gohman2010-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105550 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR6951 by fixing Module leaks in bugpoint.Jeffrey Yasskin2010-05-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103523 91177308-0d34-0410-b5e6-96231b3b80d8
* The llc -f flag was removed.Nick Lewycky2010-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102670 91177308-0d34-0410-b5e6-96231b3b80d8
* Boolify.Benjamin Kramer2010-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101035 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove use of exceptions from bugpoint. No deliberate functionality change!Nick Lewycky2010-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101013 91177308-0d34-0410-b5e6-96231b3b80d8
* remove obsolete comment.Chris Lattner2010-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93661 91177308-0d34-0410-b5e6-96231b3b80d8
* bugpoint doesn't need the mangler at all. DisambiguateGlobalSymbolsChris Lattner2010-01-16
| | | | | | | | | dates to a time when two different LLVM values could have the same name but different types. Simplify it to just assign names to unnamed things and let the core symtab resolve duplicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93660 91177308-0d34-0410-b5e6-96231b3b80d8
* switch liblto to use the new getNameWithPrefix() method instead of ↵Chris Lattner2010-01-16
| | | | | | getMangledName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-06
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -output-prefix option to bugpoint (to change the default output name).Daniel Dunbar2009-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81154 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune #includes from llvm/Linker.h and llvm/System/Path.h,Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | | forcing them down into various .cpp files. This change also: 1. Renames TimeValue::toString() and Path::toString() to ::str() for similarity with the STL. 2. Removes all stream insertion support for sys::Path, forcing clients to call .str(). 3. Removes a use of Config/alloca.h from bugpoint, using smallvector instead. 4. Weans llvm-db off <iostream> sys::Path really needs to be gutted, but I don't have the desire to do it at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
* Change bugpoint to use Triple to make runtime decisions.Daniel Dunbar2009-08-18
| | | | | | | | | | - This is cleaner, and makes bugpoint match the host instead of the build architecture. - Patch by Sandeep Patel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79309 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-31
| | | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8