aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83706 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement an efficient and fully general SSA update mechanism that Chris Lattner2009-10-102-0/+233
| | | | | | | works on unstructured CFGs. This implements PR217, our oldest open PR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83705 91177308-0d34-0410-b5e6-96231b3b80d8
* random tidyingChris Lattner2009-10-102-12/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83701 91177308-0d34-0410-b5e6-96231b3b80d8
* Use names instead of numbers for some of the magicDale Johannesen2009-10-092-9/+10
| | | | | | | | | constants used in inlining heuristics (especially those used in more than one file). No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83675 91177308-0d34-0410-b5e6-96231b3b80d8
* When considering whether to inline Callee into Caller,Dale Johannesen2009-10-091-6/+70
| | | | | | | | | | | and that will make Caller too big to inline, see if it might be better to inline Caller into its callers instead. This situation is described in PR 2973, although I haven't tried the specific case in SPASS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83602 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83555 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83510 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column and whitespace fixes.Eric Christopher2009-10-071-135/+156
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83489 91177308-0d34-0410-b5e6-96231b3b80d8
* Add FreeInst to the "is a call" check for Insts that are calls, butEric Christopher2009-10-071-2/+2
| | | | | | | not intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83441 91177308-0d34-0410-b5e6-96231b3b80d8
* While we still have a MallocInst treat it as a call like any otherEric Christopher2009-10-071-0/+4
| | | | | | | | | | for inlining. When MallocInst goes away this code will be subsumed as part of calls and work just fine... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83434 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake file.Ted Kremenek2009-10-061-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83404 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83390 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-0610-38/+38
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unnnecessary LLVMContext argument inDan Gohman2009-10-054-11/+7
| | | | | | | ConstantFoldLoadThroughGEPConstantExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83311 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Use::operator= instead of Use::set, for consistency.Dan Gohman2009-10-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83310 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine shouldn't delete all null checks for mallocs.Chris Lattner2009-10-051-2/+2
| | | | | | | This fixes PR5130. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83290 91177308-0d34-0410-b5e6-96231b3b80d8
* Do away with the strange use of BitVectors in SSI, and just use normal sets. ↵Owen Anderson2009-10-041-116/+90
| | | | | | This makes the code much more C++/LLVM-ish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83286 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in the comment.Owen Anderson2009-10-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83283 91177308-0d34-0410-b5e6-96231b3b80d8
* SSI needs to require DT and DF transitively, since it uses them outside of ↵Owen Anderson2009-10-041-3/+3
| | | | | | | | | its runOnFunction. Similarly, it can be marked setPreservesAll, since it does no work in its runOnFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83282 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow -inline-threshold override default threshold even if compiling to ↵Evan Cheng2009-10-041-0/+1
| | | | | | optimize for size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83274 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove GVNPRE.cpp from the CMake makefileDouglas Gregor2009-10-011-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83194 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the GVNPRE pass. It has been subsumed by the GVN pass.Chris Lattner2009-10-011-1893/+0
| | | | | | | | Ok'd by Owen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83193 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this code so that it doesn't try to iterate through a std::vectorDan Gohman2009-09-301-3/+4
| | | | | | | | while calling changeImmediateDominator, which removes elements from the vector. This fixes PR5097. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83166 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a redundant #ifndef and add an assertion string.Dan Gohman2009-09-281-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82991 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.Dan Gohman2009-09-282-146/+89
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82990 91177308-0d34-0410-b5e6-96231b3b80d8
* The select instruction is not neccesarily in the same block as theChris Lattner2009-09-281-2/+3
| | | | | | | | | phi nodes. Make sure to phi translate from the right block. This fixes a llvm-building-llvm failure on GVN-PRE.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82970 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code.Chris Lattner2009-09-271-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82936 91177308-0d34-0410-b5e6-96231b3b80d8
* The bitcast case is not needed here: instcombine turns icmp(bitcast(x), ↵Chris Lattner2009-09-271-24/+7
| | | | | | null) -> icmp(x, null) already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82935 91177308-0d34-0410-b5e6-96231b3b80d8
* calls are already unmovable, malloc doesn't need a special case.Chris Lattner2009-09-271-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82933 91177308-0d34-0410-b5e6-96231b3b80d8
* calls to external functions are already marked overdefined, special casingChris Lattner2009-09-271-5/+1
| | | | | | | malloc isn't needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82932 91177308-0d34-0410-b5e6-96231b3b80d8
* calls are already handled, malloc doesn't need a special case.Chris Lattner2009-09-271-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82931 91177308-0d34-0410-b5e6-96231b3b80d8
* calls are rejected above, no need to special case malloc here.Chris Lattner2009-09-271-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82929 91177308-0d34-0410-b5e6-96231b3b80d8
* remove special handling of bitcast(malloc), it will be handledChris Lattner2009-09-271-5/+4
| | | | | | | when the loop inspects the bitcast operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82928 91177308-0d34-0410-b5e6-96231b3b80d8
* unlike the malloc instruction, "malloc" calls do not claim to be readonly, ↵Chris Lattner2009-09-271-1/+1
| | | | | | just nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82927 91177308-0d34-0410-b5e6-96231b3b80d8
* allow pushing icmps through phis with multiple uses and across critical edges.Chris Lattner2009-09-271-8/+23
| | | | | | | These are important to push up to encourage jump threading. This shrinks 176.gcc a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82923 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance the previous fix for PR4895 to allow more values than justChris Lattner2009-09-271-13/+26
| | | | | | | | simple constants for the true/false value of the select. We now do phi translation etc. This really fixes PR4895 :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82917 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR4895, by making FoldOpIntoPhi handle select conditionsChris Lattner2009-09-271-11/+42
| | | | | | | | | | | that are phi nodes. Also tighten up FoldOpIntoPhi to treat constantexpr operands to phis just like other variables, avoiding moving constantexpr computations around. Patch by Daniel Dunbar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82913 91177308-0d34-0410-b5e6-96231b3b80d8
* Grab an LLVM Context from an instruction that exists rather than oneDan Gohman2009-09-271-1/+1
| | | | | | | that is deleted in some situations. This fixes a use-after-free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82903 91177308-0d34-0410-b5e6-96231b3b80d8
* Tell ScalarEvolution to forget everything it knows about a loop beforeDan Gohman2009-09-271-0/+5
| | | | | | | rotating the loop, since loop rotation is a very significant change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82901 91177308-0d34-0410-b5e6-96231b3b80d8
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-2712-26/+19
| | | | | | | update all the callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyLibCalls to transfer attributes from callees rather thanDan Gohman2009-09-261-4/+7
| | | | | | | | calls, since direct calls don't always reflect the attributes of their callees. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82867 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstantFP's getInf to getInfinity.Dan Gohman2009-09-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82823 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform pow(x, 0.5) to (x == -inf ? inf : fabs(sqrt(x))), which isDan Gohman2009-09-251-15/+19
| | | | | | | typically faster then doing a general pow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82819 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant propagating byval pointer is safe if function is readonly.Edwin Török2009-09-242-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82700 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't constant propagate byval pointers, since they are not really pointers, butEdwin Török2009-09-242-1/+6
| | | | | | | | rather structs passed by value. This fixes PR5038. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82689 91177308-0d34-0410-b5e6-96231b3b80d8
* A minor improvment in accuracy to inline costDale Johannesen2009-09-231-6/+14
| | | | | | | | computation, and some cosmetics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82660 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upChris Lattner2009-09-211-7/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82488 91177308-0d34-0410-b5e6-96231b3b80d8
* big endian systems shift by bits too, hopefully this will fix the ppc Chris Lattner2009-09-211-1/+1
| | | | | | | bootstrap problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82464 91177308-0d34-0410-b5e6-96231b3b80d8
* Nick pointed out that DominanceFrontier and DominanceTree are preservedDan Gohman2009-09-211-2/+0
| | | | | | | by setPreservesCFG(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82463 91177308-0d34-0410-b5e6-96231b3b80d8