Commit Graph

809 Commits

Author SHA1 Message Date
Chris Lattner f7544873de Fix bug: TailDup/2003-06-24-Simpleloop.ll
llvm-svn: 6881
2003-06-24 19:48:06 +00:00
Chris Lattner 55d4bda861 Implement new transforms:
Replace (cast (sub A, B) to bool) -> (setne A, B)
  Replace (cast (add A, B) to bool) -> (setne A, -B)

llvm-svn: 6873
2003-06-23 21:59:52 +00:00
Chris Lattner bf2c46254a avoid dividing by zero when dealing with zero sized types (like [0 x double])
llvm-svn: 6862
2003-06-23 17:36:49 +00:00
Chris Lattner 92963de6fa Add paranoia checking
llvm-svn: 6856
2003-06-22 20:46:00 +00:00
Chris Lattner 268c1392da Test change
llvm-svn: 6852
2003-06-22 20:25:27 +00:00
Chris Lattner a5434caa5c Initial checkin of Tail duplication pass.
llvm-svn: 6846
2003-06-22 20:10:28 +00:00
Chris Lattner d0d51605b2 Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ...
This fixes type safety problems in a variety of benchmarks that were confusing
DSA.

llvm-svn: 6837
2003-06-21 23:12:02 +00:00
Chris Lattner 0024dff76f Fix the build. :(
llvm-svn: 6797
2003-06-20 14:36:52 +00:00
Chris Lattner d01460495e Changes to privatize NodeType
llvm-svn: 6795
2003-06-19 21:15:26 +00:00
Chris Lattner 970c33abb1 Implement the functionality of InstCombine/call.ll
llvm-svn: 6783
2003-06-19 17:00:31 +00:00
Chris Lattner bbe2dab909 Remove a bunch of complicated code. The functionality is implemented in instcombine instead
llvm-svn: 6782
2003-06-19 16:59:19 +00:00
Chris Lattner 5d3c145d4e Handle arguments passed in through the va_arg area
llvm-svn: 6769
2003-06-18 16:25:51 +00:00
Chris Lattner 13bf28c00a Initial checkin of DAE pass
llvm-svn: 6759
2003-06-17 22:21:05 +00:00
Chris Lattner 2a8c301c9f Don't corrupt memory when removing an instruction from the program, but
not the worklist

llvm-svn: 6733
2003-06-17 03:57:18 +00:00
Chris Lattner dc62f1e021 Fix bug: ADCE/2003-06-11-InvalidCFG.ll
This was because we were deleting large chunks of functions without an exit block, because the post-dominance
information was not useful.  This broke crafty and twolf.

llvm-svn: 6698
2003-06-16 12:10:45 +00:00
Chris Lattner 706548fca7 Fix bug: LevelRaise/2003-06-07-EmptyArrayTest.ll
llvm-svn: 6669
2003-06-07 21:45:42 +00:00
Chris Lattner bf2be2163b Fix compilation problem on GCC 2.9x
llvm-svn: 6667
2003-06-07 20:29:58 +00:00
Chris Lattner 45789aca97 Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.ll
llvm-svn: 6630
2003-06-05 20:12:51 +00:00
Anand Shukla 2fd8edd659 Fixed a bug so initialization code is always inserted in main
llvm-svn: 6622
2003-06-05 06:02:46 +00:00
Chris Lattner 3cc301834e Use a constant expr GEP instead of an actual instruction
llvm-svn: 6620
2003-06-05 04:48:18 +00:00
Chris Lattner a485efa141 Make this work with counter > 127
llvm-svn: 6613
2003-06-04 20:08:47 +00:00
Sumant Kowshik c318ca1a51 Made changes suggested by Chris
llvm-svn: 6606
2003-06-04 08:03:57 +00:00
Chris Lattner e967b348bf Clean up previous code.
Add new combination to turn seteq X, 0 -> not(cast X to bool)

llvm-svn: 6604
2003-06-04 05:10:11 +00:00
Chris Lattner 9eef8a78b4 Implement combination of boolean not with branch
llvm-svn: 6599
2003-06-04 04:46:00 +00:00
Chris Lattner 791ac1a4c8 Implement xform: (X != 0) -> (bool)X
llvm-svn: 6506
2003-06-01 03:35:25 +00:00
Anand Shukla 03a2134253 Added the #(internal functions) to output
llvm-svn: 6502
2003-06-01 02:40:49 +00:00
Chris Lattner 2b1329611b Fix bug: FunctionResolve/2003-05-31-AllInternalDecls.ll
llvm-svn: 6486
2003-05-31 21:57:06 +00:00
Chris Lattner 080436820e Fix bug: FuncResolve/2003-05-31-InternalDecl.ll
Count resolutions correctly.

llvm-svn: 6482
2003-05-31 21:08:45 +00:00
Chris Lattner 709c1d469b Simplify funcresolve a bit more
llvm-svn: 6480
2003-05-31 20:44:46 +00:00
Chris Lattner 5ef98de61c Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll
llvm-svn: 6479
2003-05-31 20:33:31 +00:00
Tanya Lattner e2d74c1c81 Fixed comment width, changed arg to be const, fixed indentation, removed unnecessary includes.
llvm-svn: 6476
2003-05-31 20:01:37 +00:00
Chris Lattner 0078d9c5bb Okay totally give up on trying to optimize aggregates that cannot be completely
broken up into their elements.  Too many programs break because of this.

llvm-svn: 6440
2003-05-30 19:22:14 +00:00
Chris Lattner d847be0539 add a check that allows the SRoA pass to avoid breaking programs, even if their
behavior is technically undefined

llvm-svn: 6438
2003-05-30 18:09:57 +00:00
Tanya Lattner 71e56e278c Added the CloneTrace function which clones traces. It takes a vector of basic blocks, removes
internal phi nodes, and returns a new vector of basic blocks.

llvm-svn: 6431
2003-05-30 15:50:18 +00:00
Chris Lattner 38d88c07f4 Fix bug: ScalarRepl/2003-05-30-MultiLevel.ll
llvm-svn: 6428
2003-05-30 05:26:30 +00:00
Chris Lattner 6e5398d69d Fix bug: ScalarRepl/2003-05-29-ArrayFail.ll
llvm-svn: 6425
2003-05-30 04:15:41 +00:00
Sumant Kowshik 04c1382291 Added support for function pointers
llvm-svn: 6420
2003-05-29 22:42:44 +00:00
Chris Lattner 6c81ebc97d Add comment
llvm-svn: 6415
2003-05-29 20:26:30 +00:00
Chris Lattner f789f29aaa Eliminate unnecessary ->get calls that are now automatically handled.
llvm-svn: 6397
2003-05-29 15:12:27 +00:00
Chris Lattner 530d4bffbf * Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter.  :)

llvm-svn: 6396
2003-05-29 15:11:31 +00:00
Chris Lattner 3442844742 Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll
llvm-svn: 6352
2003-05-27 16:40:51 +00:00
Chris Lattner c16b210349 * Actually USE the statistic that we made
* Implement SRoA for arrays

llvm-svn: 6349
2003-05-27 16:09:27 +00:00
Chris Lattner fb41a50d15 Implementation of the simple "scalar replacement of aggregates" transformation
llvm-svn: 6346
2003-05-27 15:45:27 +00:00
Chris Lattner 196897c424 Fix bug: InstCombine/2003-05-26-CastMiscompile.ll
llvm-svn: 6338
2003-05-26 23:41:32 +00:00
Chris Lattner 8d0a71aff8 Remove using declarations
llvm-svn: 6306
2003-05-22 22:00:07 +00:00
Chris Lattner 224ae025ef Make the list accept comma separated names
llvm-svn: 6295
2003-05-22 20:27:13 +00:00
Chris Lattner ad44cd840b * Revert to old behavior of ignoring a module if it doesn't contain a main
function and no symbols were explicitly marked to be externalized.
* Add new -internalize-public-api-list option that can be used if the symbol
  list is small, and making a new file is annoying.

llvm-svn: 6289
2003-05-22 19:48:00 +00:00
Chris Lattner 44457bb5ea Add option to internalize to allow it to read a file to determine which symbols
should not be internalized

llvm-svn: 6288
2003-05-22 19:34:49 +00:00
Chris Lattner 471bd76281 Minor cleanups.
This hunk:
-    } else if (Src->getNumOperands() == 2 && Src->use_size() == 1) {
+    } else if (Src->getNumOperands() == 2) {

Allows GEP folding to be more aggressive, which reduces the number of instructions
and can dramatically speed up BasicAA in some cases.

llvm-svn: 6286
2003-05-22 19:07:21 +00:00
Chris Lattner fa58d79cf2 Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll
llvm-svn: 6273
2003-05-21 20:51:52 +00:00