Commit Graph

800 Commits

Author SHA1 Message Date
Chris Lattner
9fe3886678 Implement the functionality of InstCombine/call.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6783 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 17:00:31 +00:00
Chris Lattner
a3df1ff807 Remove a bunch of complicated code. The functionality is implemented in instcombine instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 16:59:19 +00:00
Chris Lattner
97f4b664cd Handle arguments passed in through the va_arg area
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6769 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 16:25:51 +00:00
Chris Lattner
08227e4f17 Initial checkin of DAE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6759 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 22:21:05 +00:00
Chris Lattner
bea68b3021 Don't corrupt memory when removing an instruction from the program, but
not the worklist


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6733 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 03:57:18 +00:00
Chris Lattner
34e353e560 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6698 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:10:45 +00:00
Chris Lattner
e32487ebff Fix bug: LevelRaise/2003-06-07-EmptyArrayTest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6669 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 21:45:42 +00:00
Chris Lattner
4432d8f3b5 Fix compilation problem on GCC 2.9x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 20:29:58 +00:00
Chris Lattner
9b5fd22bd9 Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6630 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 20:12:51 +00:00
Anand Shukla
cd0cc61329 Fixed a bug so initialization code is always inserted in main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6622 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 06:02:46 +00:00
Chris Lattner
d3646f1586 Use a constant expr GEP instead of an actual instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6620 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 04:48:18 +00:00
Chris Lattner
fa9ee73a7d Make this work with counter > 127
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6613 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 20:08:47 +00:00
Sumant Kowshik
9271ade15b Made changes suggested by Chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6606 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 08:03:57 +00:00
Chris Lattner
40f5d70db4 Clean up previous code.
Add new combination to turn seteq X, 0 -> not(cast X to bool)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 05:10:11 +00:00
Chris Lattner
c4d10ebcd7 Implement combination of boolean not with branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6599 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 04:46:00 +00:00
Chris Lattner
074d84c746 Implement xform: (X != 0) -> (bool)X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6506 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 03:35:25 +00:00
Anand Shukla
619754fb18 Added the #(internal functions) to output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6502 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 02:40:49 +00:00
Chris Lattner
c16e631e94 Fix bug: FunctionResolve/2003-05-31-AllInternalDecls.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6486 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 21:57:06 +00:00
Chris Lattner
12ce59d3c5 Fix bug: FuncResolve/2003-05-31-InternalDecl.ll
Count resolutions correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6482 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 21:08:45 +00:00
Chris Lattner
40c4959e9f Simplify funcresolve a bit more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6480 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 20:44:46 +00:00
Chris Lattner
567cceea49 Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6479 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 20:33:31 +00:00
Tanya Lattner
658c5bcdb2 Fixed comment width, changed arg to be const, fixed indentation, removed unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6476 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 20:01:37 +00:00
Chris Lattner
b37923f9a1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6440 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 19:22:14 +00:00
Chris Lattner
26d2ca1d13 add a check that allows the SRoA pass to avoid breaking programs, even if their
behavior is technically undefined


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6438 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 18:09:57 +00:00
Tanya Lattner
6074d2f37a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 15:50:18 +00:00
Chris Lattner
261d686737 Fix bug: ScalarRepl/2003-05-30-MultiLevel.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6428 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 05:26:30 +00:00
Chris Lattner
5e062a1eda Fix bug: ScalarRepl/2003-05-29-ArrayFail.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6425 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 04:15:41 +00:00
Sumant Kowshik
a78220fe2d Added support for function pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6420 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 22:42:44 +00:00
Chris Lattner
faf4cc2da0 Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6415 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 20:26:30 +00:00
Chris Lattner
ab2b328c78 Eliminate unnecessary ->get calls that are now automatically handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6397 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 15:12:27 +00:00
Chris Lattner
ca398dc398 * Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6396 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 15:11:31 +00:00
Chris Lattner
2a9c847f25 Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6352 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 16:40:51 +00:00
Chris Lattner
d10376bee5 * Actually USE the statistic that we made
* Implement SRoA for arrays


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6349 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 16:09:27 +00:00
Chris Lattner
ed7b41ea90 Implementation of the simple "scalar replacement of aggregates" transformation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6346 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 15:45:27 +00:00
Chris Lattner
bd4ecf769d Fix bug: InstCombine/2003-05-26-CastMiscompile.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6338 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-26 23:41:32 +00:00
Chris Lattner
de579f11ff Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6306 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 22:00:07 +00:00
Chris Lattner
88c7c3295d Make the list accept comma separated names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 20:27:13 +00:00
Chris Lattner
2345d71853 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 19:48:00 +00:00
Chris Lattner
c7a2c7f0c9 Add option to internalize to allow it to read a file to determine which symbols
should not be internalized


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 19:34:49 +00:00
Chris Lattner
c54e2b8f84 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6286 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 19:07:21 +00:00
Chris Lattner
c52b30dcfb Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 20:51:52 +00:00
Misha Brukman
82c89b9f3a Hopefully, the final fix for `[Pp]ropogate'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6251 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 21:01:22 +00:00
Misha Brukman
f117cc9ee6 s/convertable/convertible/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 18:45:36 +00:00
Chris Lattner
6d23d97e90 Fix long standing bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6232 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-15 18:25:13 +00:00
Chris Lattner
4c00e53b81 Fix Bug: Linker/2003-05-15-TypeProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-15 16:30:55 +00:00
Chris Lattner
f41464618f Fix major problem with appending linkage changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6185 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 12:11:51 +00:00
Chris Lattner
8166e6eef6 Implement linkage of appending global variables!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6178 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-13 21:33:43 +00:00
Chris Lattner
8f6396e80f Fix bug: LoopPreheaders/2003-05-12-PreheaderExitOfChild.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 22:04:34 +00:00
Chris Lattner
1d16ec7381 Handle va_arg instruction correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:50:13 +00:00
Chris Lattner
8d8f20e47a Don't inline functions that take variable numbers of arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6024 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:36:43 +00:00