Commit Graph

684 Commits

Author SHA1 Message Date
Anton Korobeynikov
bed2946a96 Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 18:10:23 +00:00
Chris Lattner
83ae2fcacc fix SimplifyLibCalls/IsDigit.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 05:38:40 +00:00
Chris Lattner
ae143ceb83 avoid iterator invalidation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 18:06:52 +00:00
Jeff Cohen
98a72203d7 An even better fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 17:18:29 +00:00
Jeff Cohen
e4aee1d3a4 Fix recent regression that broke several llvm-tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 16:55:19 +00:00
Chris Lattner
35b9b49fd1 Implement a few missing xforms: printf("foo\n") -> puts. printf("x") -> putchar
printf("") -> noop.  Still need to do the xforms for fprintf.

This implements Transforms/SimplifyLibCalls/Printf.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 01:17:48 +00:00
Chris Lattner
8264a9fcca in addition to merging, constantmerge should also delete trivially dead globals,
in order to clean up after simplifylibcalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 01:11:54 +00:00
Lauro Ramos Venancio
c763552299 Implement the "thread_local" keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 18:32:50 +00:00
Chris Lattner
51047859ed Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35768 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-08 18:11:26 +00:00
Chris Lattner
5cef3c6eb7 implement a fixme: move optimizations for fwrite out of fputs into a new
fwrite optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-08 07:00:35 +00:00
Chris Lattner
0cd3a23d2a Significantly simplify the clients of GetConstantStringInfo, by having it
just return the string itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 21:58:02 +00:00
Chris Lattner
73f5d42a97 Fix problems in the sprintf optimizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 21:17:51 +00:00
Chris Lattner
3492cda48f Change CastToCStr to take a pointer instead of a reference.
Fix some miscompilations in fprintf optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35753 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 21:04:50 +00:00
Chris Lattner
af33e6579a Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
and Prolangs-C/cdecl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 20:19:08 +00:00
Owen Anderson
c6fcf29e81 Expunge DomSet from CodeExtractor. This is part of the continuing work
on PR1171.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 05:31:27 +00:00
Chris Lattner
045af54275 fix a miscompilation in printf optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 01:18:36 +00:00
Chris Lattner
ef4fd35726 trunc to bool no longer compares against zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 01:03:46 +00:00
Chris Lattner
71bf3e2ef9 cleanups for strlen optimizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 01:02:00 +00:00
Chris Lattner
679d7188c7 Introduce a new ReplaceCallWith method, which simplifies a lot of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 00:42:32 +00:00
Chris Lattner
db895b82a3 fixes for strcpy optimizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 00:26:18 +00:00
Chris Lattner
7b50c8f278 Fix bugs in strncmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 00:06:57 +00:00
Chris Lattner
ceb375ecf2 fix 3 miscompilations and several compielr crashes in strcmp optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 00:01:51 +00:00
Chris Lattner
6897fe5861 Fix several nasty bugs in the strchr optimizer, this fixes
SimplifyLibCalls/2007-04-06-strchr-miscompile.ll and PR1307


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-06 23:38:55 +00:00
Chris Lattner
09c11aa7f5 clean up strcat optimizer, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-06 22:59:33 +00:00
Chris Lattner
c8e1741bb9 rename getConstantStringLength -> GetConstantStringInfo. Make it return
the start index of the array as well as the length.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-06 22:54:17 +00:00
Chris Lattner
4913bf47fd Fix Transforms/GlobalOpt/2007-04-05-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-05 21:09:42 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Reid Spencer
cae5754619 Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 00:28:52 +00:00
Reid Spencer
a0e0129e3f Use APInt conversion to string so the result is correct regardless of the
bit width of the ConstantInt being converted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 21:00:32 +00:00
Chris Lattner
4a6f363491 fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34395 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-18 22:10:58 +00:00
Chris Lattner
eb47391994 simplify pass, delete dead gvar protos as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-18 22:10:34 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
c18470cb00 eliminate a bunch of vector-related heap traffic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 05:58:53 +00:00
Chris Lattner
93e985f1b1 Eliminate use of ctors that take vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34219 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 02:10:56 +00:00
Chris Lattner
1ccd185cb4 stop using methods that take vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34205 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 22:56:41 +00:00
Chris Lattner
dec628eead Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 05:18:08 +00:00
Chris Lattner
046800a712 simplify name juggling through the use of Value::takeName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 01:08:35 +00:00
Chris Lattner
3cfc1d22b2 Fix Transforms/DeadArgElim/2007-02-07-FuncRename.ll, fallout from PR411.
This happened because deadargelim now causes VMCore to auto-rename every
function that it hacks arguments out of.  Because it hacks arguments out of
functions in a non-deterministic order, this caused the resultant numbering
to be nondet.  The fix is to just be careful to not rename functions!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34005 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 19:31:33 +00:00
Chris Lattner
7f1444bc0a shrink vmcore by moving symbol table stripping support out of VMCore into
the one IPO pass that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33990 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:22:45 +00:00
Reid Spencer
9133fe2895 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 23:32:05 +00:00
Reid Spencer
7ea07659a1 Add missing and needed #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 21:47:39 +00:00
Reid Spencer
9153a6729f Make the class VISIBILITY_HIDDEN.
Reduce lexical size of the anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33925 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 21:45:12 +00:00
Reid Spencer
688b0490e2 For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 21:19:13 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Reid Spencer
15468bfc22 For PR411:
This pass is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:41:05 +00:00
Reid Spencer
c19fbd6ec8 Create a pass to strip dead function declarations (prototypes). This is
for use by llvm-extract and bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33916 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:24:25 +00:00
Reid Spencer
832254e1c2 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Chris Lattner
699d144a4b eliminate temporary vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 19:59:55 +00:00
Chris Lattner
55eb1c47de eliminate temporary vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33693 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:40:53 +00:00
Chris Lattner
79066fa6ac Adjust #includes to match movement of constant folding code from transformutils to libanalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33680 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 23:46:24 +00:00