summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Change Library Names Not To Conflict With Others When InstalledReid Spencer2004-10-277-7/+7
| | | | llvm-svn: 17286
* Convert 'struct' to 'class' in various places to adhere to the coding standardsChris Lattner2004-10-273-3/+4
| | | | | | and work better with VC++. Patch contributed by Morten Ofstad! llvm-svn: 17281
* Hrm, this code was severely botched. As it turns out, this patch:Chris Lattner2004-10-271-0/+4
| | | | | | | | | | | http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill the zion nightly tester disk up and make the tester barf. This is obviously not a good thing, so lets fix this bug shall we? :) llvm-svn: 17276
* Initialize with the correct constant typeChris Lattner2004-10-271-2/+3
| | | | llvm-svn: 17270
* Fix compatibility with MSVC, patch by Morten OfstadChris Lattner2004-10-251-0/+1
| | | | llvm-svn: 17218
* Eliminate compilation warning on uninitialized variable.Reid Spencer2004-10-221-1/+1
| | | | llvm-svn: 17163
* *** empty log message ***Chris Lattner2004-10-221-4/+47
| | | | llvm-svn: 17161
* Fix a bug Nate noticed, where we miscompiled a simple testcaseChris Lattner2004-10-221-1/+1
| | | | llvm-svn: 17157
* We won't use automakeReid Spencer2004-10-2214-5188/+0
| | | | llvm-svn: 17155
* Explain what this pass does.Brian Gaeke2004-10-201-1/+7
| | | | llvm-svn: 17146
* Hrm, some people complain when the compiler cheerfully tells them what it'sChris Lattner2004-10-191-1/+0
| | | | | | doing... I guess they're right. llvm-svn: 17142
* Initial automake generated Makefile templateReid Spencer2004-10-187-0/+4989
| | | | llvm-svn: 17136
* Initial implementation of the strength reduction for GEP instructions inNate Begeman2004-10-181-0/+251
| | | | | | | | | | | | | | | | | loops. This optimization is not turned on by default yet, but may be run with the opt tool's -loop-reduce flag. There are many FIXMEs listed in the code that will make it far more applicable to a wide range of code, but you have to start somewhere :) This limited version currently triggers on the following tests in the MultiSource directory: pcompress2: 7 times cfrac: 5 times anagram: 2 times ks: 6 times yacr2: 2 times llvm-svn: 17134
* Get this file compiling with VC++, patch contributed by Morten Ofstad. ↵Chris Lattner2004-10-181-0/+1
| | | | | | Thanks Morten! llvm-svn: 17125
* Correction to allow compilation with Visual C++.Reid Spencer2004-10-184-6/+8
| | | | | | Patch contributed by Morten Ofstad. Thanks Morten! llvm-svn: 17123
* Simplify code by deleting instructions that preceed unreachable instructions.Chris Lattner2004-10-181-1/+101
| | | | | | | Simplify code by simplifying terminators that branch to blocks that start with an unreachable instruction. llvm-svn: 17116
* Turn store -> null/undef into the LLVM unreachable instruction! This simpleChris Lattner2004-10-181-0/+27
| | | | | | | | change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end is not generating them yet and we are not optimizing the resultant code. This isn't too bad. llvm-svn: 17111
* Turn things with obviously undefined semantics into 'store -> null'Chris Lattner2004-10-181-26/+34
| | | | llvm-svn: 17110
* My friend the invoke instruction does not dominate all basic blocks if itChris Lattner2004-10-181-1/+2
| | | | | | occurs in the entry node of a function llvm-svn: 17109
* Fix a bug that occurs when the constant value is the result of an invoke. InChris Lattner2004-10-181-5/+6
| | | | | | | particular, invoke ret values are only live in the normal dest of the invoke not in the unwind dest. llvm-svn: 17108
* Getting ADCE to interact well with unreachable instructions seems like a ↵Chris Lattner2004-10-171-2/+3
| | | | | | | | | | | nontrivial exercise that I'm not interested in tackling right now. Just punt and treat them like unwind's. This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll llvm-svn: 17106
* Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.llChris Lattner2004-10-171-4/+8
| | | | | | | If a function had no return instruction in it, and the result of the inlined call instruction was used, we would crash. llvm-svn: 17104
* Remove printout, realize that instructions in the entry block dominate allChris Lattner2004-10-171-6/+6
| | | | | | other blocks. llvm-svn: 17099
* When inserting PHI nodes, don't insert any phi nodes that are obviouslyChris Lattner2004-10-171-10/+31
| | | | | | | | | unneccesary. This allows us to delete several hundred phi nodes of the form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well. This implements Mem2Reg/UndefValuesMerge.ll llvm-svn: 17098
* Enhance hasConstantValue to ignore undef values in phi nodes. This allows itChris Lattner2004-10-171-2/+3
| | | | | | to think that PHI[4, undef] == 4. llvm-svn: 17096
* hasConstantValue will soon return instructions that don't dominate the PHI node,Chris Lattner2004-10-172-20/+39
| | | | | | so prepare for this. llvm-svn: 17095
* Fix a type violationChris Lattner2004-10-161-1/+1
| | | | llvm-svn: 17069
* Kill the bogon that slipped into my buffer before I committed.Chris Lattner2004-10-161-1/+1
| | | | llvm-svn: 17067
* Implement InstCombine/getelementptr.ll:test9, which is the source of manyChris Lattner2004-10-161-0/+18
| | | | | | ugly and giant constnat exprs in some programs. llvm-svn: 17066
* Add support for unreachableChris Lattner2004-10-161-3/+23
| | | | llvm-svn: 17056
* Optimize instructions involving undef values. For example X+undef == undef.Chris Lattner2004-10-161-27/+125
| | | | llvm-svn: 17047
* Add support for UndefValueChris Lattner2004-10-161-1/+2
| | | | llvm-svn: 17046
* When promoting mem2reg, make uninitialized values become undef isntead of 0.Chris Lattner2004-10-161-9/+9
| | | | llvm-svn: 17045
* Handle undef values as undefined on the constant latticeChris Lattner2004-10-161-3/+6
| | | | | | ignore unreachable instructions llvm-svn: 17044
* Add noteChris Lattner2004-10-161-0/+1
| | | | llvm-svn: 17043
* Add support for the undef value. Implement a new optimization based on globalsChris Lattner2004-10-161-22/+56
| | | | | | | that are initialized with undef. When promoting malloc to a global, start out initialized to undef llvm-svn: 17042
* Fix a bug John tracked down in libstdc++ where we were incorrectly deletingChris Lattner2004-10-141-1/+2
| | | | | | weak functions. Thanks for finding this John! llvm-svn: 16997
* When converting phi nodes into select instructions, we shouldn't promote PHIChris Lattner2004-10-141-41/+93
| | | | | | | | nodes unless we KNOW that we are able to promote all of them. This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll llvm-svn: 16973
* Update to reflect changes in Makefile rules.Reid Spencer2004-10-137-28/+21
| | | | llvm-svn: 16950
* Transform memmove -> memcpy when the source is obviously constant memory.Chris Lattner2004-10-121-16/+33
| | | | llvm-svn: 16932
* Fix a REALLY obscure bug in my previous checkin, which was splicing the ENDChris Lattner2004-10-121-1/+1
| | | | | | marker from one ilist into the middle of another basic block! llvm-svn: 16925
* Handle a common case more carefully. In particular, instead of transformingChris Lattner2004-10-111-4/+33
| | | | | | | | | | | | | | | | | pointer recurrences into expressions from this: %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ] %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1 ; <sbyte*> [#uses=2] into this: %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec Actually create something nice, like this: %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec llvm-svn: 16924
* Reenable the transform, turning X/-10 < 1 into X > -10Chris Lattner2004-10-111-5/+5
| | | | llvm-svn: 16918
* This patch implements two things (sorry).Chris Lattner2004-10-111-25/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, it allows SRA of globals that have embedded arrays, implementing GlobalOpt/globalsra-partial.llx. This comes up infrequently, but does allow, for example, deleting several stores to dead parts of globals in dhrystone. Second, this implements GlobalOpt/malloc-promote-*.llx, which is the following nifty transformation: Basically if a global pointer is initialized with malloc, and we can tell that the program won't notice, we transform this: struct foo *FooPtr; ... FooPtr = malloc(sizeof(struct foo)); ... FooPtr->A FooPtr->B Into: struct foo FooPtrBody; ... FooPtrBody.A FooPtrBody.B This comes up occasionally, for example, the 'disp' global in 183.equake (where the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%) on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue' globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)). The nice thing about this xform is that it exposes the resulting global to global variable optimization and makes alias analysis easier in addition to eliminating a few loads. llvm-svn: 16916
* Just because we cannot completely eliminate all uses of a global, we canChris Lattner2004-10-101-27/+124
| | | | | | | | | | | | | | | | still optimize away all of the indirect calls and loads, etc from it. This turns code like this: if (G != 0) G(); into if (G != 0) ActualCallee(); This triggers a couple of times in gcc and libstdc++. llvm-svn: 16901
* Initial version of automake Makefile.am file.Reid Spencer2004-10-107-0/+206
| | | | llvm-svn: 16893
* Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a castChris Lattner2004-10-101-20/+23
| | | | llvm-svn: 16878
* Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are onlyChris Lattner2004-10-101-0/+11
| | | | | | | stored to, but are stored at variable indexes. This occurs at least in 176.gcc, but probably others, and we should handle it for completeness. llvm-svn: 16876
* Avoid calling use_size() which could (in theory) be expensive if the globalChris Lattner2004-10-101-12/+18
| | | | | | | | | has a large number of users. Instead, just keep track of whether we're making changes as we do so. This patch has no functionlity changes. llvm-svn: 16874
* Eliminate global pointers that are only stored a single value and null ifChris Lattner2004-10-091-0/+103
| | | | | | | | | | | | | | | | | | | | | we know that all uses of the global will trap if the pointer contained is null. In this case, we forward substitute the stored value to any uses. This has the effect of devirtualizing trivial globals in trivial cases. For example, 164.gzip contains this: gzip.h:extern int (*read_buf) OF((char *buf, unsigned size)); bits.c: read_buf = file_read; deflate.c: lookahead = read_buf((char*)window, deflate.c: n = read_buf((char*)window+strstart+lookahead, more); Since read_buf has to point to file_read at every use, we just replace the calls through read_buf with a direct call to file_read. This occurs in several benchmarks, including 176.gcc and 164.gzip. Direct calls are good and stuff. llvm-svn: 16871
OpenPOWER on IntegriCloud