Commit Graph

231 Commits

Author SHA1 Message Date
Misha Brukman
008248f2c0 Linker.h moved to include/llvm/Support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14351 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 17:33:09 +00:00
Chris Lattner
bed85ff010 Header file moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 05:41:36 +00:00
Reid Spencer
9231ac8b6f Convert to SymbolTable's new iteration interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 08:53:40 +00:00
Chris Lattner
7507c297d0 Turn the block extractor on by default now that it basically works, eliminating the option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13502 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-12 19:02:44 +00:00
Chris Lattner
68bee938e5 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
2004-05-12 16:08:01 +00:00
Chris Lattner
b83c0f3f63 Don't leave dead bytecode.output files around if the optimizer/block extractor crashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13477 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-12 02:55:45 +00:00
Chris Lattner
2290e75406 Implement the final missing bits for block extractor support. Now bugpoint
can extract basic blocks up to the limit of the block extractor implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13475 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-12 02:43:24 +00:00
Chris Lattner
5e783ab0b5 Implement basic block extraction for the miscompilation debugger. This still needs
two things: the FIXME in ExtractBlocks needs to be implemented, and the basic block
extractor itself needs to have enough bugs fixed for this to be more or less
useful.

Until the time that this is generally useful, it is hidden behind the new bugpoint
-enable-block-extraction option.  I hope to get the FIXME done tonight.

Also of note, this patch adds a -extract-bbs option to bugpoint which can be used
to debug the block extractor.  (hint hint Misha :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13471 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-11 21:54:13 +00:00
Chris Lattner
1c2f68631e A class that is meant to be a base class should have a virtual destructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13470 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-11 20:41:07 +00:00
Chris Lattner
60083e2fc0 Use the new commandline flag to allow us to call bugpoint like this:
bugpoint ... --tool-args -enable-correct-eh-support -regalloc=linearscan --args -- -foo

So that tool-args option gets the -enable-correct-eh-support -regalloc=linearscan flags instead of bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-06 22:05:35 +00:00
Chris Lattner
817d8d3046 Remove a really old comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13385 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-06 19:29:58 +00:00
Brian Gaeke
48b008db57 Apply simplification suggested by Chris: why assign() when operator = will do?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13364 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 22:02:41 +00:00
Brian Gaeke
636df3d7ec Add --tool-args flag which lets you pass arguments to llc or lli.
This is intended to address Bug 40.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:09:16 +00:00
Brian Gaeke
d11577b68b Add "Args" optional argument to AbstractInterpreter factory methods, which
fills in a ToolArgs vector in the AbstractInterpreter if it is set. This
ToolArgs vector is used to pass additional arguments to LLI and/or LLC.
This is intended to address Bug 40.

Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:09:01 +00:00
Chris Lattner
f4789e6d04 Teach bugpoint to be a little bit smarter and avoid repeating work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13132 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 20:36:51 +00:00
Misha Brukman
123f8fec94 Add a space before result for readability on the command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22 20:02:09 +00:00
Misha Brukman
8c194eaa05 Add doxygenified comments to functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13097 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 18:36:43 +00:00
Misha Brukman
de4803d0af As per Chris, greatly simplify handling of external functions by using the
wrapper idea uniformly: we can use Value::replaceAllUsesWith() instead of
special-casing by class of user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13063 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:36:47 +00:00
Misha Brukman
b687d82b02 * Reorder #includes
* Wrap a long line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13061 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:12:35 +00:00
Misha Brukman
dc7fef83dc Finally implement rewriting global initializers which use external functions
by creating an internal wrapper function with same signature as the external
function, and use it instead of the "real" function.

The wrapper then calls the external function using the same JIT function
resolution API that has been used before for rewriting instructions, since the
wrapper has an explicit call instruction which we can rewrite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 01:12:01 +00:00
Chris Lattner
36ee07ff9d Disambiguate symbols after loop extraction so that we can diagnose a code
generator bug if multiple loops are extracted from a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 23:52:35 +00:00
Chris Lattner
2423db0e85 Fix an obvious bug in the refactoring I did a few days ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12797 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 22:28:33 +00:00
Misha Brukman
b04da8a3c6 Wrap at 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12701 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 17:04:30 +00:00
Chris Lattner
a57d86b436 Merge the code generator miscompilation code into the optimizer miscompilation
code.  This "instantly" gives us loop-extractor power to assist with the
debugment of our nasty codegen issues.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12678 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 22:58:16 +00:00
Chris Lattner
11b8cd197a Make a method public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12677 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 22:01:48 +00:00
Chris Lattner
9ae427a14c Minor cleanups, remove some old debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12676 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 21:37:55 +00:00
Chris Lattner
b15825b0a2 Refactor and genericize code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12675 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 21:37:38 +00:00
Chris Lattner
8505c867b1 lli no longer takes the -quiet option!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12674 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 20:28:41 +00:00
Chris Lattner
30878f42c2 Make full use of the Mangler interface to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12671 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:31:02 +00:00
Chris Lattner
af48fa8259 Minor change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12655 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:31:50 +00:00
Chris Lattner
fb4b96e77e Minor speedup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12612 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 16:28:32 +00:00
Chris Lattner
02bb481881 minor formatting change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12606 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 06:32:45 +00:00
Chris Lattner
5313f23b8c Fix two pretty serious bugs:
1. Each time the loop extractor extracted a loop, we would leak a module.
  2. When we extracted a loop, we didn't add the new function to the list of
     miscompiled functions.  Thus if the bug was in a loop nest and we
     extracted it, we could actually *LOSE THE BUG*, which is very bad.

With these patches, bugpoint has successfully found a bug for me in a function
with several nested loops, and cut it down to just one of them. :) :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12605 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 06:32:17 +00:00
Chris Lattner
87ab7e994f Fix a fairly nasty bug that prevented bugpoint from working quite right when
hacking on programs with two functions that have the same name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12604 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 06:30:33 +00:00
Chris Lattner
58d84ced5f If the program returns a non-zero exit value, don't leave files laying
around


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12603 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 05:33:06 +00:00
Chris Lattner
d3a533d94d When loop extraction succeeds, make sure to map the function pointers over
to avoid dangling references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12470 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 17:42:09 +00:00
Chris Lattner
7fa44fca30 Fix an inverted condition that causes us to think that loop extraction
accomplished something when it really did not.  This does not fix the bigger problem tho.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12469 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 17:37:18 +00:00
Chris Lattner
9d5968dd51 Fix an iterator invalidation problem in a "buggy" pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12468 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 17:29:08 +00:00
Chris Lattner
002dbddccd Fix thinko, and PR292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12426 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 01:51:54 +00:00
Chris Lattner
a1cf1c8c87 After reducing a miscompiled program down to the functions which are being
miscompiled, try to use the loop extractor to reduce the program down to a
loop nest that is being miscompiled.  In practice, the loop extractor appears
to have too many bugs for this to be useful, but hopefully they will be fixed
soon...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12398 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 22:08:00 +00:00
Chris Lattner
44a64bccac Fix a minor bug in runPassesOn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12397 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 21:37:41 +00:00
Chris Lattner
0a00256900 Add a new "AutoDebugCrashes" option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12396 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 21:21:57 +00:00
Chris Lattner
a75766a6c1 Refactor to use a new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12395 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 21:17:22 +00:00
Chris Lattner
3b6441e105 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12394 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 21:17:03 +00:00
Chris Lattner
efdc0b5057 Refactor and clean up a bunch more code. No major functionality changes.
* Make several methods of bugdriver global functions (ParseInputFile, PrintFunctionList)
 * Make PrintFunctionList truncate the output after 10 entries, like the crash debugger
   did.  This allows code sharing.
 * Add a couple of methods to BugDriver that allows us to eliminate some friends
 * Improve comments in ExtractFunction.cpp
 * Make classes that used to be friends up bugdriver now live in anon namespaces
 * Rip a bunch of functionality in the miscompilation tester into a new
   TestMergedProgram function for future code sharing.
 * Fix a bug in the miscompilation tester induced in my last checkin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12393 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 20:50:42 +00:00
Chris Lattner
7546c3884a Add a method to extract a loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 20:02:07 +00:00
Chris Lattner
5eda1f2f65 add a fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12388 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 19:31:00 +00:00
Chris Lattner
be21ca54e0 Refactor all of the "splitting a module into two pieces" code to avoid
code duplication.  Also, don't use ReduceMiscompilingFunctions::TestFuncs
to print out the final message.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12387 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 19:27:19 +00:00
Chris Lattner
b2c180f04e Fix the "infinite looping unless you disable adce" bug
Also remove an option to disable adce :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12359 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-13 19:35:54 +00:00
Brian Gaeke
744b5fb93f Revise comment and error message for the Bug 38 situation. Also, make it
print out the name of the function being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12347 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 21:37:46 +00:00