summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint
Commit message (Collapse)AuthorAgeFilesLines
...
* ValueMapper: Add support for seeding metadata with nullptrDuncan P. N. Exon Smith2016-04-021-1/+1
| | | | | | | | | | | | | Support seeding a ValueMap with nullptr for Metadata entries, a situation I didn't consider in the Metadata/Value split. I added a ValueMapper::getMappedMD accessor that returns an Optional<Metadata*> with the mapped (possibly null) metadata. IRMover needs to use this to avoid modifying the map when it's checking for unneeded subprograms. I updated a call from bugpoint since I find the new code clearer. llvm-svn: 265228
* Add an IR Verifier check for orphaned DICompileUnits.Adrian Prantl2016-03-281-1/+3
| | | | | | | | | A DICompileUnit that is not listed in llvm.dbg.cu will cause assertion failures and/or crashes in the backend. The Verifier should reject this. rdar://problem/25369499 llvm-svn: 264657
* Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.Eugene Zelenko2016-02-021-8/+5
| | | | | | Differential revision: http://reviews.llvm.org/D16793 llvm-svn: 259539
* Avoid overly large SmallPtrSet/SmallSetMatthias Braun2016-01-301-2/+2
| | | | | | | These sets perform linear searching in small mode so it is never a good idea to use SmallSize/N bigger than 32. llvm-svn: 259283
* Remove autoconf supportChris Bieneman2016-01-261-18/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Change linkInModule to take a std::unique_ptr.Rafael Espindola2015-12-162-5/+6
| | | | | | | Passing in a std::unique_ptr should help find errors when the module is used after being linked into another module. llvm-svn: 255842
* Use diagnostic handler in the LLVMContextRafael Espindola2015-12-142-23/+5
| | | | | | | | | | | | | | | | This patch converts code that has access to a LLVMContext to not take a diagnostic handler. This has a few advantages * It is easier to use a consistent diagnostic handler in a single program. * Less clutter since we are not passing a handler around. It does make it a bit awkward to implement some C APIs that return a diagnostic string. I will propose new versions of these APIs and deprecate the current ones. llvm-svn: 255571
* Simplify testMergedProgram.Rafael Espindola2015-12-091-26/+19
| | | | | | It now receives and returns std::unique_ptr. llvm-svn: 255087
* Simplify memory management. NFC.Rafael Espindola2015-12-091-79/+72
| | | | | | | This passes std::unique_ptr to predicates that are expected to delete their argument. llvm-svn: 255086
* Return std::unique_ptr from SplitFunctionsOutOfModule. NFC.Rafael Espindola2015-12-093-30/+25
| | | | llvm-svn: 255084
* Simplify memory management. NFC.Rafael Espindola2015-12-091-11/+10
| | | | llvm-svn: 255082
* Simplify memory management a bit. NFC.Rafael Espindola2015-12-091-9/+8
| | | | llvm-svn: 255079
* Return a std::unique_ptr from CloneModule. NFC.Rafael Espindola2015-12-083-22/+22
| | | | llvm-svn: 255078
* Always pass a diagnostic handler to the linker.Rafael Espindola2015-12-042-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Before this patch the diagnostic handler was optional. If it was not passed, the one in the LLVMContext was used. That is probably not a pattern we want to follow. If each area has an optional callback, there is a sea of callbacks and it is hard to follow which one is called. Doing this also found cases where the callback is a nice addition, like testing that no errors or warnings are reported. The other option is to always use the diagnostic handler in the LLVMContext. That has a few problems * To implement the C API we would have to set the diag handler and then set it back to the original value. * Code that creates the context might be far away from code that wants the diagnostics. I do have a patch that implements the second option and will send that as an RFC. llvm-svn: 254777
* Use references now that it is natural to do so.Rafael Espindola2015-12-012-5/+5
| | | | | | | The linker never takes ownership of a module or changes which module it is refering to, making it natural to use references. llvm-svn: 254449
* [bugpoint] Fix "Alias must point to a definition" problemsHal Finkel2015-11-263-4/+41
| | | | | | | | | | | | | | | | | | GlobalAliases may reference function definitions, but not function declarations. bugpoint would sometimes create invalid IR by deleting a function's body (thus mutating a function definition into a declaration) without first 'fixing' any GlobalAliases that reference that function definition. This change iteratively prevents that issue. Before deleting a function's body, it scans the module for GlobalAliases which reference that function. When found, it eliminates them using replaceAllUsesWith. Fixes PR20788. Patch by Nick Johnson! llvm-svn: 254171
* Make bugpoint ehpad/token friendlyDavid Majnemer2015-11-081-4/+5
| | | | | | | Tokens shouldn't be blindly replaced with undef/null. Also, don't try to remove EH pad instructions from the top of basic blocks. llvm-svn: 252414
* Fix bugpoint breakage on libcxx introduced by r252247Keno Fischer2015-11-061-2/+2
| | | | llvm-svn: 252253
* [bugpoint] Add a named metadata (+their operands) reducerKeno Fischer2015-11-061-0/+173
| | | | | | | | | | | | | | | | | | | Summary: We frequently run bugpoint on a linked module that consists of all modules we create while jitting the julia standard library. This module has a very large number of compile units (10000+) in `llvm.dbg.cu`, which didn't get reduced at all, requiring manual post processing. This is an attempt to have bugpoint go through and attempt to reduce the number of global named metadata nodes as well as their operands, to cut down the number of roots for such metadata. Reviewers: dexonsmith, reames, pete Subscribers: pete, dexonsmith, reames, llvm-commits Differential Revision: http://reviews.llvm.org/D14043 llvm-svn: 252247
* bugpoint: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-203-56/+47
| | | | | | | | This is the last of the implicit ilist iterator conversions in LLVM. Still up for debate whether we let these bitrot back: http://lists.llvm.org/pipermail/llvm-dev/2015-October/091617.html llvm-svn: 250852
* [bugpoint] llvm-gcc doesn't exist anymore ...Davide Italiano2015-10-151-8/+1
| | | | | | ... so this comment is stale. Remove it. Range-loopify while here. llvm-svn: 250354
* [Bugpoint] Use 'CC' instead of 'GCC' for variable naming.Davide Italiano2015-10-146-149/+149
| | | | | | | | | | We now use clang by default and fallback to gcc when requested. With this commit, names reflect reality. No functional change intended. Discussed with: Rafael Espindola. llvm-svn: 250321
* [Bugpoint] Use clang by default.Davide Italiano2015-10-141-2/+9
| | | | | | | | | | We now rely on gcc only if either of the following is true: 1) -gcc option is passed by the user 2) clang is not found in the default path. Differential Revision: http://reviews.llvm.org/D13642 llvm-svn: 250318
* [Bugpoint] Get rid of dead code. No functional change.Davide Italiano2015-10-111-19/+0
| | | | llvm-svn: 249999
* Replace some calls to isa<LandingPadInst> with isEHPad()David Majnemer2015-08-191-1/+1
| | | | | | No functionality change is intended. llvm-svn: 245487
* [PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth2015-08-182-2/+0
| | | | | | | | | | | | | | | | | | | | | folding the code into the main Analysis library. There already wasn't much of a distinction between Analysis and IPA. A number of the passes in Analysis are actually IPA passes, and there doesn't seem to be any advantage to separating them. Moreover, it makes it hard to have interactions between analyses that are both local and interprocedural. In trying to make the Alias Analysis infrastructure work with the new pass manager, it becomes particularly awkward to navigate this split. I've tried to find all the places where we referenced this, but I may have missed some. I have also adjusted the C API to continue to be equivalently functional after this change. Differential Revision: http://reviews.llvm.org/D12075 llvm-svn: 245318
* bugpoint: make the number of trim iterations a compile-time constantTobias Grosser2015-07-261-3/+9
| | | | | | | | | | | | Around 10 year ago Chris limited this code to a single iteration by just dropping a break into the loop body. We now make the number of trim iterations a compile time constant to be able to play with it and see if this can improve the bugpoint results. We currently use with '3' still a small and conservative value, but this can be adjusted in the future, if needed. I tried to look for a trivial test case, but did not succeed yet. llvm-svn: 243247
* Wrap some long lines in LLVMBuild files. NFCDouglas Katzman2015-06-121-1/+11
| | | | | | | As suggested by jroelofs in a prior review (D9752), it makes sense to generally prefer multi-line format. llvm-svn: 239632
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-292-10/+5
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [bugpoint] Increase default memory limit to 400MB to fix bugpoint tests.Daniel Sanders2015-05-051-2/+2
| | | | | | | | I tracked down the bug to an unchecked malloc in SmallVectorBase::grow_pod(). This malloc is returning NULL on my machine when running under bugpoint but not when -enable-valgrind is given. llvm-svn: 236504
* bugpoint Enhancement.JF Bastien2015-04-201-7/+79
| | | | | | | | | | | | | | | | | | | Summary: This patch adds two flags to `bugpoint`: "-replace-funcs-with-null" and "-disable-pass-list-reduction". When "-replace-funcs-with-null" is specified, bugpoint will, instead of simply deleting function bodies, replace all uses of functions and then will delete functions completely from the test module, correctly handling aliasing and @llvm.used && @llvm.compiler.used. This part was conceived while trying to debug the PNaCl IR simplification passes, which don't allow undefined functions (ie no declarations). With "-disable-pass-list-reduction", bugpoint won't try to reduce the set of passes causing the "crash". This is needed in cases where one is trying to debug an issue inside the PNaCl IR simplification passes which is causing an PNaCl ABI verification error, for example. Reviewers: jfb Reviewed By: jfb Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D8555 llvm-svn: 235362
* uselistorder: Remove the global bitsDuncan P. N. Exon Smith2015-04-152-8/+7
| | | | | | | | | | | | | Remove all the global bits to do with preserving use-list order by moving the `cl::opt`s to the individual tools that want them. There's a minor functionality change to `libLTO`, in that you can't send in `-preserve-bc-uselistorder=false`, but making that bit settable (if it's worth doing) should be through explicit LTO API. As a drive-by fix, I removed some includes of `UseListOrder.h` that were made unnecessary by recent commits. llvm-svn: 234973
* uselistorder: Pull the bit through WriteToBitcodFile()Duncan P. N. Exon Smith2015-04-151-2/+3
| | | | | | | | | | | Change the callers of `WriteToBitcodeFile()` to pass `true` or `shouldPreserveBitcodeUseListOrder()` explicitly. I left the callers that want to send `false` alone. I'll keep pushing the bit higher until hopefully I can delete the global `cl::opt` entirely. llvm-svn: 234957
* IR: Set -preserve-bc-uselistorder=false by defaultDuncan P. N. Exon Smith2015-04-141-0/+5
| | | | | | | But keep it on by default in `llvm-as`, `opt`, `bugpoint`, `llvm-link`, `llvm-extract`, and `LTOCodeGenerator`. Part of PR5680. llvm-svn: 234921
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* [opaque pointer type] API migration for GEP constant factoriesDavid Blaikie2015-04-021-1/+2
| | | | | | | | | | | | | Require the pointee type to be passed explicitly and assert that it is correct. For now it's possible to pass nullptr here (and I've done so in a few places in this patch) but eventually that will be disallowed once all clients have been updated or removed. It'll be a long road to get all the way there... but if you have the cahnce to update your callers to pass the type explicitly without depending on a pointer's element type, that would be a good thing to do soon and a necessary thing to do eventually. llvm-svn: 233938
* tools: Unify how verifyModule() is calledDuncan P. N. Exon Smith2015-03-311-1/+1
| | | | | | | | | Unify the error messages for the various tools when `verifyModule()` fails on an input module. The "brave new way" is: lltool: path/to/input.ll: error: input module is broken! llvm-svn: 233667
* bugpoint: Verify input filesDuncan P. N. Exon Smith2015-03-261-0/+6
| | | | | | Like r233229 for `llvm-link`, start verifying input files to `bugpoint`. llvm-svn: 233253
* bugpoint: Return early after error, NFCDuncan P. N. Exon Smith2015-03-261-10/+10
| | | | llvm-svn: 233252
* Verifier: Remove the separate -verify-di passDuncan P. N. Exon Smith2015-03-191-1/+0
| | | | | | | | | | | | | | Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass. Instead, call into the `DebugInfoVerifier` from inside `VerifierLegacyPass::finalizeModule()`. This better matches the logic in `verifyModule()` (used by the new PassManager), avoids requiring two separate passes to verify the IR, and makes the API for "add a pass to verify the IR" simple. Note: the `-verify-debug-info` flag still works (for now, at least; eventually it might make sense to just remove it). llvm-svn: 232772
* CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner2015-03-181-1/+1
| | | | | | | | | | | | | | The MSVC linker won't produce a .lib file for an executable that doesn't export anything, and LLVM doesn't maintain dllexport annotations or .def files listing all C++ symbols. It also doesn't support exporting all symbols, like binutils ld. CMake 3.2 changed the Ninja generator to list both the .exe and .lib files as outputs of executable build targets. Ninja would always re-link executables with ENABLE_EXPORTS because the .lib output file was not present, and therefore the target was out of date. llvm-svn: 232662
* Teach raw_ostream to accept SmallString.Yaron Keren2015-03-101-7/+7
| | | | | | | | | | | | | | Saves adding .str() call to any raw_ostream << SmallString usage and a small step towards making .str() consistent in the ADTs by removing one of the SmallString::str() use cases, discussion at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html I'll update the Phabricator patch http://reviews.llvm.org/D6372 for review of the Twine SmallString support, it's more complex than this one. llvm-svn: 231763
* Replace a few instances of NULL with nullptr.David Majnemer2015-02-261-2/+2
| | | | llvm-svn: 230599
* [PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth2015-02-134-6/+6
| | | | | | | | | | | | | | | | | | | | LLVM's include tree and the use of using declarations to hide the 'legacy' namespace for the old pass manager. This undoes the primary modules-hostile change I made to keep out-of-tree targets building. I sent an email inquiring about whether this would be reasonable to do at this phase and people seemed fine with it, so making it a reality. This should allow us to start bootstrapping with modules to a certain extent along with making it easier to mix and match headers in general. The updates to any code for users of LLVM are very mechanical. Switch from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h". Qualify the types which now produce compile errors with "legacy::". The most common ones are "PassManager", "PassManagerBase", and "FunctionPassManager". llvm-svn: 229094
* Fix style.Michael J. Spencer2014-11-071-8/+6
| | | | llvm-svn: 221547
* Use findProgramByName.Michael J. Spencer2014-11-042-17/+41
| | | | llvm-svn: 221221
* Remove the PreserveSource linker mode.Rafael Espindola2014-10-282-7/+5
| | | | | | | | | | | | | | | | | | | | I noticed that it was untested, and forcing it on caused some tests to fail: LLVM :: Linker/metadata-a.ll LLVM :: Linker/prefixdata.ll LLVM :: Linker/type-unique-odr-a.ll LLVM :: Linker/type-unique-simple-a.ll LLVM :: Linker/type-unique-simple2-a.ll LLVM :: Linker/type-unique-simple2.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/unnamed-addr1-a.ll LLVM :: Linker/visibility1.ll If it is to be resurrected, it has to be fixed and we should probably have a -preserve-source command line option in llvm-mc and run tests with and without it. llvm-svn: 220741
* Update the error handling of lib/Linker.Rafael Espindola2014-10-252-29/+8
| | | | | | Instead of passing a std::string&, use the new diagnostic infrastructure. llvm-svn: 220608
* Delete -std-compile-opts.Rafael Espindola2014-10-161-10/+0
| | | | | | These days -std-compile-opts was just a silly alias for -O3. llvm-svn: 219951
* [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to closeLang Hames2014-10-071-9/+1
| | | | | | | | | | this, and in some circumstances (e.g. reducing particularly large test-cases) this was causing bugpoint to be killed for hitting open file-handle limits. No test case: I was only able to trigger this with test cases taking upwards of 10 mins to run. llvm-svn: 219244
OpenPOWER on IntegriCloud