Commit Graph

252 Commits

Author SHA1 Message Date
Misha Brukman 0fd3172754 Made a bunch of cleanups, as per Chris' recommendations:
* Removed unused global and member variables
* Fixed comments (CodeGeneratorBug.cpp)
* Check for possibly failing GCC::create() and CBE::create()
* Remove generated files after diffing the output (e.g., shared object)
* Instead of using std::for_each, use explicit loops as std::for_each may
  duplicate the functor, and ours carries state
* Changed member var from cl::opt<std::string> to just std::string
* Fixed doxygen comments
* Fixed string comparisons to use [ str.empty() ] instead of [ str == "" ]
* Cache instances of CBE and GCC in BugDriver across compilations and executions
  while testing tools.

llvm-svn: 7302
2003-07-24 21:59:10 +00:00
Misha Brukman d792c9bb46 Major addition to bugpoint: ability to debug code generators (LLC and LLI).
The C backend is assumed correct and is used to generate shared objects to be
loaded by the other two code generators.

LLC debugging should be functional now, LLI needs a few more additions to work,
the major one is renaming of external functions to call the JIT lazy function
resolver.

Bugpoint now has a command-line switch -mode with options 'compile' and
'codegen' to debug appropriate portions of tools.

ExecutionDriver.cpp: Added implementations of AbstractInterpreter for LLC and
GCC, broke out common code within other tools, and added ability to generate C
code with CBE individually, without executing the program, and the GCC tool can
generate executables shared objects or executables.

If no reference output is specified to Bugpoint, it will be generated with CBE,
because it is already assumed to be correct for the purposes of debugging using
this method. As a result, many functions now accept as an optional parameter a
shared object to be loaded in, if specified.

llvm-svn: 7293
2003-07-24 18:17:43 +00:00
Misha Brukman 6a6587ab02 Fixed misspelling.
llvm-svn: 7223
2003-07-21 21:58:16 +00:00
Misha Brukman 7fdaab4f68 The word `separate' only has one `e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner 2599356122 Try to run cleanups even if nothing was modified in the preview passes
llvm-svn: 6897
2003-06-25 04:13:52 +00:00
Chris Lattner 0192b72fde Run dead arg elimination, and tell it that it's ok to hack up non-internal functions
llvm-svn: 6896
2003-06-25 04:13:36 +00:00
Brian Gaeke e38c7d9f2d Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where
it is needed.

llvm-svn: 6753
2003-06-17 20:09:18 +00:00
Chris Lattner 55491774bb Actually, change it to use explicit new/delete, which is more likely to be
optimized INTO an alloca

llvm-svn: 6727
2003-06-16 22:29:09 +00:00
Chris Lattner 7bdbd91e92 Remove usage of alloca
llvm-svn: 6726
2003-06-16 22:22:11 +00:00
Brian Gaeke 7a719ed20c Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.

llvm-svn: 6723
2003-06-16 21:54:01 +00:00
Chris Lattner a965631408 Remove stupid thinko that was preventing bugpoint from working
llvm-svn: 6533
2003-06-02 04:54:29 +00:00
Chris Lattner b165ea31b7 Give better information about how the passes crash
llvm-svn: 6532
2003-06-02 04:54:16 +00:00
Brian Gaeke 61a05da4d5 Clarify BugDriver.cpp:BugDriver::ParseInputFile()'s return values in its
explanatory comment.

llvm-svn: 6308
2003-05-23 05:34:32 +00:00
Chris Lattner d9b159587b Allow disabling final cleanups
llvm-svn: 6271
2003-05-21 20:38:59 +00:00
Chris Lattner 2b3ab562f6 Increase odds that this won't bork things
llvm-svn: 6267
2003-05-21 19:41:31 +00:00
Chris Lattner a95548f56c Print filename correctly
llvm-svn: 6119
2003-05-12 14:32:04 +00:00
Chris Lattner 823ce22ef2 Make a comment more accurate
llvm-svn: 5991
2003-05-03 03:20:36 +00:00
Chris Lattner 7709ec5df5 Add support for debugging miscompilations with the use of the JIT or CBE!
llvm-svn: 5990
2003-05-03 03:19:41 +00:00
Chris Lattner 9e97f4acb6 Bugpoint is always verbose, eliminate option
llvm-svn: 5989
2003-05-03 03:18:41 +00:00
Misha Brukman f3d3bcb485 The Grammar Police is out on patrol.
llvm-svn: 5985
2003-05-03 02:16:43 +00:00
Chris Lattner 8d8de422dd Add options to disable simplification with passes, in case one of them crashes
llvm-svn: 5950
2003-04-25 22:08:12 +00:00
Chris Lattner 0347cda8b8 Rename Kept -> Suffix
FIX problem where we were incorrectly putting the prefix of the list into the "suffix" list.

llvm-svn: 5926
2003-04-25 03:16:33 +00:00
Chris Lattner 4a1a9d2cdd Rename Kept -> Suffix
Fix problem where we accidentally returned KeepPrefix instead of KeepSuffix!

llvm-svn: 5925
2003-04-25 03:16:05 +00:00
Chris Lattner 65e5f653fd Big programs have tons of global variable initializers, and most passes don't care
about them.  Try to delete them if it doesn't affect the passes.

llvm-svn: 5918
2003-04-25 00:53:05 +00:00
Chris Lattner b0143880f4 When cleaning up the final bytecode file, make sure to run DTE as well
llvm-svn: 5917
2003-04-25 00:52:30 +00:00
Chris Lattner f32939bbc9 Speed up convergence significantly and also reduce the size of testcases by making large portions of a function's CFG dead at a time.
llvm-svn: 5915
2003-04-24 23:51:38 +00:00
Chris Lattner de39f2bdac The big fix is this change:
-    if (I->isExternal() && !Functions.count(I))
+    if (!I->isExternal() && !Functions.count(I))

We were not actually deleting any functions from the module!

llvm-svn: 5914
2003-04-24 22:54:06 +00:00
Chris Lattner 10c0469be1 Remove dead functions
llvm-svn: 5913
2003-04-24 22:53:24 +00:00
Chris Lattner c3380918a5 Make sure that deleted functions have external linkage
llvm-svn: 5912
2003-04-24 22:53:01 +00:00
Chris Lattner 1d080f24c5 Use the list reducer to improve convergence speed and to support crashes that
only occur when multiple passes interact or when multiple functions exist in a module

llvm-svn: 5911
2003-04-24 22:24:58 +00:00
Chris Lattner ba159e2824 Adjust to match new ListReducer interface
Move function to generic code

llvm-svn: 5910
2003-04-24 22:24:22 +00:00
Chris Lattner 69f8e6f7aa Allow reducer interfaces to mutate the lists passed in
llvm-svn: 5909
2003-04-24 22:23:56 +00:00
Chris Lattner 39388ca08e Move function from Miscompilation.cpp
llvm-svn: 5908
2003-04-24 22:23:34 +00:00
Chris Lattner 9f5a197eb6 Move the ListReducer Class into it's own header file instead of living in Miscompilation.cpp
llvm-svn: 5907
2003-04-24 20:16:29 +00:00
Chris Lattner b052843bd2 Allow bugpoint to try new an different methods for pruning down lists
llvm-svn: 5905
2003-04-24 19:32:42 +00:00
Chris Lattner d571e2aa91 Make sure to create a target data that matches the Module's target properties.
llvm-svn: 5904
2003-04-24 19:13:02 +00:00
Chris Lattner aa038c856a Remove support for "target data" pass ctors
llvm-svn: 5900
2003-04-24 18:36:41 +00:00
Chris Lattner 16a413103c Implement support for bugpoint to identify which FUNCTION an optimization
is miscompiling.

llvm-svn: 5893
2003-04-24 17:02:17 +00:00
Chris Lattner 1b35bee37c Print where reference output goes
llvm-svn: 5891
2003-04-23 20:41:18 +00:00
Chris Lattner 68efaa7ad9 Allow specifying an input file for the program being executed
llvm-svn: 5888
2003-04-23 20:31:37 +00:00
Chris Lattner e695da3f54 Remove unnecessary &*
llvm-svn: 5873
2003-04-23 16:38:00 +00:00
Chris Lattner 44ffd7c373 Make sure that intermediate code is verifier clean to avoid wierd problems.
llvm-svn: 5723
2003-03-07 18:17:13 +00:00
Chris Lattner 514c02eb26 * Reduce the number of useless bytecode files produced by bugpoint.
- This also speeds it up as the bytecode writer isn't terribly fast.
* Add a new cleanup pass after everything else to run -funcresolve -globaldce

llvm-svn: 5668
2003-02-28 16:13:20 +00:00
Chris Lattner e0e1b0d2a6 Fix build problem on sparc
llvm-svn: 5428
2003-01-29 18:15:34 +00:00
Chris Lattner 0eb5ce94dd Make bugpoint *much* more powerful, giving it the capability to delete instructions
out of a large function to reduce it.

llvm-svn: 5408
2003-01-23 02:48:33 +00:00
Chris Lattner 892f93730b Allow creating of passes like levelraise which use a targetdata ctor
llvm-svn: 5403
2003-01-22 23:24:11 +00:00
Chris Lattner ae2c1b7f15 Link in lots o libraries
llvm-svn: 5269
2003-01-14 21:30:30 +00:00
Chris Lattner 7c0f86233f Fix compilation on GCC 3.2
llvm-svn: 5136
2002-12-24 00:44:34 +00:00
Chris Lattner de4aa4cf8c New files for miscompilation detection
llvm-svn: 5120
2002-12-23 23:50:16 +00:00
Chris Lattner d4e0474dcf Implement the start of the miscompilation detection stuff
llvm-svn: 5119
2002-12-23 23:49:59 +00:00
Chris Lattner 73a6bdd958 Initial checkin of bugpoint
llvm-svn: 4789
2002-11-20 22:28:10 +00:00