summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* 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
* remove the GVNPRE pass. It has been subsumed by the GVN pass.Chris Lattner2009-10-011-1893/+0
| | | | | | Ok'd by Owen. llvm-svn: 83193
* 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 llvm-svn: 82970
* simplify some code.Chris Lattner2009-09-271-2/+2
| | | | llvm-svn: 82936
* The bitcast case is not needed here: instcombine turns icmp(bitcast(x), ↵Chris Lattner2009-09-271-24/+7
| | | | | | null) -> icmp(x, null) already. llvm-svn: 82935
* calls are already unmovable, malloc doesn't need a special case.Chris Lattner2009-09-271-2/+1
| | | | llvm-svn: 82933
* calls to external functions are already marked overdefined, special casingChris Lattner2009-09-271-5/+1
| | | | | | malloc isn't needed. llvm-svn: 82932
* calls are rejected above, no need to special case malloc here.Chris Lattner2009-09-271-3/+2
| | | | llvm-svn: 82929
* 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. llvm-svn: 82923
* 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 :) llvm-svn: 82917
* 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. llvm-svn: 82913
* 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. llvm-svn: 82903
* 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. llvm-svn: 82901
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-277-13/+8
| | | | | | update all the callers. llvm-svn: 82889
* 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. llvm-svn: 82867
* Rename ConstantFP's getInf to getInfinity.Dan Gohman2009-09-251-2/+2
| | | | llvm-svn: 82823
* 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. llvm-svn: 82819
* Constant propagating byval pointer is safe if function is readonly.Torok Edwin2009-09-241-1/+1
| | | | llvm-svn: 82700
* Don't constant propagate byval pointers, since they are not really pointers, butTorok Edwin2009-09-241-0/+4
| | | | | | | rather structs passed by value. This fixes PR5038. llvm-svn: 82689
* big endian systems shift by bits too, hopefully this will fix the ppc Chris Lattner2009-09-211-1/+1
| | | | | | bootstrap problems. llvm-svn: 82464
* Nick pointed out that DominanceFrontier and DominanceTree are preservedDan Gohman2009-09-211-2/+0
| | | | | | by setPreservesCFG(). llvm-svn: 82463
* Remove the special-case for constants in PHI nodes; it's not reallyDan Gohman2009-09-211-3/+0
| | | | | | | helpful, and it didn't correctly handle the case of constants input to PHIs for backedges. llvm-svn: 82462
* fix PR5016, a crash I introduced in GVN handing first classChris Lattner2009-09-211-10/+38
| | | | | | arrays and structs, which cannot be bitcast to integers. llvm-svn: 82460
* enable non-local analysis and PRE of large store -> little load.Chris Lattner2009-09-211-30/+66
| | | | | | | This doesn't kick in too much because of phi translation issues, but this can be resolved in the future. llvm-svn: 82447
* convert an std::pair to an explicit struct.Chris Lattner2009-09-211-17/+32
| | | | llvm-svn: 82446
* move some functions, add a comment.Chris Lattner2009-09-211-164/+165
| | | | llvm-svn: 82444
* split HandleLoadFromClobberingStore in two pieces: one that does theChris Lattner2009-09-211-21/+41
| | | | | | analysis, one that does the xform. llvm-svn: 82443
* Improve GVN to be able to forward substitute a small load Chris Lattner2009-09-211-7/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a piece of a large store when both are in the same block. This allows clang to compile the testcase in PR4216 to this code: _test_bitfield: movl 4(%esp), %eax movl %eax, %ecx andl $-65536, %ecx orl $32962, %eax andl $40186, %eax orl %ecx, %eax ret This is not ideal, but is a whole lot better than the code produced by llvm-gcc: _test_bitfield: movw $-32574, %ax orw 4(%esp), %ax andw $-25350, %ax movw %ax, 4(%esp) movw 7(%esp), %cx shlw $8, %cx movzbl 6(%esp), %edx orw %cx, %dx movzwl %dx, %ecx shll $16, %ecx movzwl %ax, %eax orl %ecx, %eax ret and dramatically better than that produced by gcc 4.2: _test_bitfield: pushl %ebx call L3 "L00000000001$pb": L3: popl %ebx movl 8(%esp), %eax leal 0(,%eax,4), %edx sarb $7, %dl movl %eax, %ecx andl $7168, %ecx andl $-7201, %ebx movzbl %dl, %edx andl $1, %edx sall $5, %edx orl %ecx, %ebx orl %edx, %ebx andl $24, %eax andl $-58336, %ebx orl %eax, %ebx orl $32962, %ebx movl %ebx, %eax popl %ebx ret llvm-svn: 82439
* formatting cleanups, no functionality change.Chris Lattner2009-09-211-118/+116
| | | | llvm-svn: 82426
* Move CoerceAvailableValueToLoadType earlier in GVN.cpp. Hook it upChris Lattner2009-09-201-105/+152
| | | | | | | | so that nonlocal and partially redundant loads can use it as well. The testcase shows examples of craziness this can handle. This triggers *many* times in 176.gcc. llvm-svn: 82403
* change the interface to CoerceAvailableValueToLoadType to be Chris Lattner2009-09-201-15/+21
| | | | | | more generic. llvm-svn: 82402
* enhance GVN to forward substitute a stored value to a loadChris Lattner2009-09-201-15/+129
| | | | | | | | (and load -> load) when the base pointers must alias but when they are different types. This occurs very very frequently in 176.gcc and other code that uses bitfields a lot. llvm-svn: 82399
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-211/+211
| | | | llvm-svn: 82355
* Enhance transform passes so that they apply the same tranforms to malloc ↵Victor Hernandez2009-09-186-17/+78
| | | | | | | | calls as to MallocInst. Reviewed by Dan Gohman. llvm-svn: 82300
* Update CMake.Daniel Dunbar2009-09-171-0/+1
| | | | llvm-svn: 82097
* Add a new pass for doing late hoisting of floating-point and vectorDan Gohman2009-09-161-0/+117
| | | | | | | | | | | constants out of loops. These aren't covered by the regular LICM pass, because in LLVM IR constants don't require separate instructions. They're not always covered by the MachineLICM pass either, because it doesn't know how to unfold folded constant-pool loads. This is somewhat experimental at this point, and off by default. llvm-svn: 82076
* Change FoldPHIArgBinOpIntoPHI to decline folding if it would introduce twoDan Gohman2009-09-161-7/+13
| | | | | | | | phis, similar to the FoldPHIArgGEPIntoPHI change. Also, delete some comments that don't reflect the code. llvm-svn: 82053
* Preserve ProfileInfo during CodeGenPrepare.Andreas Neustifter2009-09-161-1/+15
| | | | llvm-svn: 82034
* Don't sink gep operators through phi nodes if the result would requireDan Gohman2009-09-161-1/+14
| | | | | | | | more than one phi, since that leads to higher register pressure on entry to the phi. This is especially problematic when the phi is in a loop header, as it increases register pressure throughout the loop. llvm-svn: 81993
* Add more newlines to make up for the ones removed from the end of instructions.Nick Lewycky2009-09-151-9/+12
| | | | llvm-svn: 81851
* add newline to debug dumpChris Lattner2009-09-151-1/+1
| | | | llvm-svn: 81840
* When extending a memset range past the front, set the alignment of theDan Gohman2009-09-141-0/+1
| | | | | | memset region to the alignment of the new start address. llvm-svn: 81810
* Fix SplitCriticalEdge to properly update LCSSA form when splitting aDan Gohman2009-09-091-16/+1
| | | | | | | | | | loop exit edge -- new PHIs may be needed not only for the additional splits that are made to preserve LoopSimplify form, but also for the original split. Factor out the code that inserts new PHIs so that it can be used for both. Remove LoopRotation.cpp's code for manually updating LCSSA form, as it is now redundant. This fixes PR4934. llvm-svn: 81363
* Reflow comment.Mike Stump2009-09-091-5/+5
| | | | llvm-svn: 81361
* Fix an 80-column violation.Dan Gohman2009-09-091-3/+3
| | | | llvm-svn: 81354
OpenPOWER on IntegriCloud