summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR4313: IPSCCP was not setting the lattice value for the invoke instructionTorok Edwin2009-10-201-2/+4
| | | | | | | | | | when the invoke had multiple return values: it set the lattice value only on the extractvalue. This caused the invoke's lattice value to remain the default (undefined), and later propagated to extractvalue's operand, which incorrectly introduces undefined behavior. llvm-svn: 84637
* Refactor lookup_or_add to contain _MUCH_ less duplicated code. Add support forOwen Anderson2009-10-191-181/+217
| | | | | | numbering first class aggregate instructions while we're at it. llvm-svn: 84547
* Simplify some code.Owen Anderson2009-10-191-124/+61
| | | | llvm-svn: 84533
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-172-31/+4
| | | | llvm-svn: 84299
* Autoupgrade malloc insts to malloc calls.Victor Hernandez2009-10-171-1/+2
| | | | | | | | Update testcases that rely on malloc insts being present. Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step. llvm-svn: 84292
* Move zext and sext casts fed by loads into the same block as theDan Gohman2009-10-161-1/+41
| | | | | | | load, to help SelectionDAG fold them into the loads, unless conditions are unfavorable. llvm-svn: 84271
* only try to fold constantexpr operands when the worklist is first populated, Chris Lattner2009-10-151-15/+30
| | | | | | | | don't bother every time going around the main worklist. This speeds up a release-asserts opt -std-compile-opts on 403.gcc by about 4% (1.5s). It seems to speed up the most expensive instances of instcombine by ~10%. llvm-svn: 84171
* don't bother calling ConstantFoldInstruction unless there is a use of theChris Lattner2009-10-151-22/+25
| | | | | | | | | instruction (which disqualifies stores, unreachable, etc) and at least the first operand is a constant. This filters out a lot of obvious cases that can't be folded. Also, switch the IRBuilder to a TargetFolder, which tries harder. llvm-svn: 84170
* Use isVoidTy()Devang Patel2009-10-144-12/+12
| | | | llvm-svn: 84118
* make instcombine's instruction sinking more aggressive in theChris Lattner2009-10-141-3/+10
| | | | | | presence of PHI nodes. llvm-svn: 84103
* Check void type before using RAUWd.Devang Patel2009-10-133-7/+27
| | | | llvm-svn: 84049
* Do not check use_empty() before replaceAllUsesWith(). This gives ↵Devang Patel2009-10-133-15/+11
| | | | | | ValueHandles a chance to get properly updated. llvm-svn: 84033
* Use the new CodeMetrics class to compute code size instead ofDan Gohman2009-10-131-6/+6
| | | | | | manually counting instructions. llvm-svn: 84016
* Make LoopUnswitch's cost estimation count Instructions, rather thanDan Gohman2009-10-131-19/+7
| | | | | | | | BasicBlocks, so that it doesn't blindly procede in the presence of large individual BasicBlocks. This addresses a class of code-size expansion problems. llvm-svn: 83992
* Make licm debug message readable.Evan Cheng2009-10-121-1/+2
| | | | llvm-svn: 83908
* Fix warning.Dale Johannesen2009-10-121-1/+1
| | | | llvm-svn: 83870
* populate instcombine's initial worklist more carefully, causingChris Lattner2009-10-121-18/+26
| | | | | | | | | | | it to visit instructions from the start of the function to the end of the function in the first path. This greatly speeds up some pathological cases (e.g. PR5150). Try #3, this time with some unneeded debug info stuff removed which was causing dead pointers to be added to the worklist. llvm-svn: 83818
* revert r83814 for now, it is making the llvm-gcc bootstrap unhappy.Chris Lattner2009-10-111-26/+1
| | | | llvm-svn: 83817
* populate instcombine's initial worklist more carefully, causingChris Lattner2009-10-111-1/+26
| | | | | | | | it to visit instructions from the start of the function to the end of the function in the first path. This greatly speeds up some pathological cases (e.g. PR5150). llvm-svn: 83814
* remove some harmful code that would turn an insertelement on an undefChris Lattner2009-10-111-22/+0
| | | | | | | | | | | into a shuffle even if it was used by another insertelement. If the visitation order of instcombine was wrong, this would turn a chain of insertelements into a chain of shufflevectors, which was quite painful. Since CollectShuffleElements handles these cases, the code can just be nuked. llvm-svn: 83810
* teach instcombine to simplify xor's harder, catching theChris Lattner2009-10-111-0/+27
| | | | | | new testcase. llvm-svn: 83799
* cleanupsChris Lattner2009-10-111-20/+18
| | | | llvm-svn: 83797
* cleanup, no functionality change.Chris Lattner2009-10-111-34/+33
| | | | llvm-svn: 83795
* generalize a transformation even more: we don't care whether theChris Lattner2009-10-111-12/+10
| | | | | | | | | input the the mul is a zext from bool, just that it is all zeros other than the low bit. This fixes some phase ordering issues that would cause us to miss some xforms in mul.ll when the worklist is visited differently. llvm-svn: 83794
* simplify a transformation by making it more general.Chris Lattner2009-10-111-32/+14
| | | | llvm-svn: 83792
* temporarily revert previous patchChris Lattner2009-10-111-14/+1
| | | | llvm-svn: 83791
* populate instcombine's initial worklist more carefully, causingChris Lattner2009-10-111-1/+14
| | | | | | | | it to visit instructions from the start of the function to the end of the function in the first path. This greatly speeds up some pathological cases (e.g. PR5150). llvm-svn: 83790
* Remove CleanupDbgInfo, instcombine does this and its not worth duplicating itTorok Edwin2009-10-111-35/+0
| | | | | | here. llvm-svn: 83789
* LICM shouldn't sink/delete debug information. Fix this and add a testcase.Torok Edwin2009-10-111-1/+39
| | | | | | | For now the metadata of sinked/hoisted instructions is still wrong, but that'll be fixed when instructions will have debug metadata directly attached. llvm-svn: 83786
* when folding duplicate conditions, delete the Chris Lattner2009-10-111-0/+2
| | | | | | now-probably-dead instruction tree feeding it. llvm-svn: 83778
* implement rdar://7293527, a trivial instcombine that llvm-gccChris Lattner2009-10-111-1/+12
| | | | | | | gets but clang doesn't, because it is implemented in GCC's fold routine. llvm-svn: 83761
* implement a transformation in jump threading that is currentlyChris Lattner2009-10-111-64/+218
| | | | | | | | | | done by condprop, but do it in a much more general form. The basic idea is that we can do a limited form of tail duplication in the case when we have a branch on a phi. Moving the branch up in to the predecessor block makes instruction selection much easier and encourages chained jump threadings. llvm-svn: 83759
* restructure some code, no functionality change.Chris Lattner2009-10-111-33/+29
| | | | llvm-svn: 83756
* factor some code better and move a function, no functionality change.Chris Lattner2009-10-111-81/+55
| | | | llvm-svn: 83755
* make jump threading on a phi with undef inputs happen.Chris Lattner2009-10-111-28/+54
| | | | llvm-svn: 83754
* switch GVN to use SSAUpdater. Besides removing a lot of complexityChris Lattner2009-10-101-151/+38
| | | | | | | | from GVN, this also speeds it up, inserts fewer PHI nodes (see the testcase) and allows it to remove more loads (due to fewer PHI nodes standing in the way). llvm-svn: 83746
* remove dead codeChris Lattner2009-10-101-65/+0
| | | | llvm-svn: 83742
* Change jump threading to use the new SSAUpdater class instead of Chris Lattner2009-10-101-16/+43
| | | | | | | | | DemoteRegToStack. This makes it more efficient (because it isn't creating a ton of load/stores that are eventually removed by a later mem2reg), and more slightly more effective (because those load/stores don't get in the way of threading). llvm-svn: 83706
* random tidyingChris Lattner2009-10-101-5/+7
| | | | llvm-svn: 83701
* Add a form of addPreserved which takes a string argument, to allow passesDan Gohman2009-10-081-4/+4
| | | | | | | | to declare that they preserve other passes without needing to pull in additional header file or library dependencies. Convert MachineFunctionPass and CodeGenLICM to make use of this. llvm-svn: 83555
* In instcombine's debug output, avoid printing ADD for instructions that areJeffrey Yasskin2009-10-081-3/+5
| | | | | | | already on the worklist, and print Visited when an instruction is about to be visited. Net, on one input, this reduced the output size by at least 9x. llvm-svn: 83510
* 80-column and whitespace fixes.Eric Christopher2009-10-071-135/+156
| | | | llvm-svn: 83489
* Update CMake file.Ted Kremenek2009-10-061-1/+0
| | | | llvm-svn: 83404
* remove predicate simplifier, it never got the last bugs beatenChris Lattner2009-10-061-2704/+0
| | | | | | | out of it, and jump threading, condprop and gvn are now getting most of the benefit. This was approved by Nicholas and Nicolas. llvm-svn: 83390
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-063-23/+23
| | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
* Remove an unnnecessary LLVMContext argument inDan Gohman2009-10-052-4/+2
| | | | | | ConstantFoldLoadThroughGEPConstantExpr. llvm-svn: 83311
* Use Use::operator= instead of Use::set, for consistency.Dan Gohman2009-10-051-2/+2
| | | | llvm-svn: 83310
* strength reduce a ton of type equality tests to check the typeid (ThroughChris Lattner2009-10-054-23/+24
| | | | | | | | the new predicates I added) instead of going through a context and doing a pointer comparison. Besides being cheaper, this allows a smart compiler to turn the if sequence into a switch. llvm-svn: 83297
* instcombine shouldn't delete all null checks for mallocs.Chris Lattner2009-10-051-2/+2
| | | | | | This fixes PR5130. llvm-svn: 83290
* Remove GVNPRE.cpp from the CMake makefileDouglas Gregor2009-10-011-1/+0
| | | | llvm-svn: 83194
OpenPOWER on IntegriCloud