aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* merge a test into store.llChris Lattner2009-11-022-37/+45
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85771 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheckChris Lattner2009-11-021-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85770 91177308-0d34-0410-b5e6-96231b3b80d8
* merge phi-merge.ll into phi.llChris Lattner2009-11-012-31/+33
| | | | | | | | I don't know what Dan wants to do with phi-merge-gep.ll, I'll let him deal with it because instcombine may end up sinking these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85739 91177308-0d34-0410-b5e6-96231b3b80d8
* when merging two loads, make sure to take the min of their alignment,Chris Lattner2009-11-011-0/+26
| | | | | | | | not the max. This didn't matter until the previous patch because instcombine would refuse to sink loads with differenting alignments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85738 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug noticed by inspection: when instcombine sinks loads throughChris Lattner2009-11-011-0/+21
| | | | | | | | | phis, it didn't preserve the alignment of the load. This is a missed optimization of the alignment is high and a miscompilation when the alignment is low. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85736 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheck.Chris Lattner2009-11-011-20/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85734 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r85667. LoopUnroll currently can't call utility functions whichDan Gohman2009-10-311-2/+0
| | | | | | | | auto-update the DominatorTree because it doesn't keep the DominatorTree current while it works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85670 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor intoDan Gohman2009-10-311-0/+2
| | | | | | | | MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive, and makes it unnecessary for LoopUnroll to have its own copy of this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85667 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for the recent duplicate PHI elimination changes.Dan Gohman2009-10-301-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85636 91177308-0d34-0410-b5e6-96231b3b80d8
* if basic blocks are destroyed while there are *just* BlockAddress' hanging Chris Lattner2009-10-301-2/+7
| | | | | | | | around, then zap them. This is analogous to dangling constantexprs hanging off functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85627 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend getMallocArraySize() to determine the array size if the malloc ↵Victor Hernandez2009-10-282-0/+82
| | | | | | | | | | | | | | | | argument is: ArraySize * ElementSize ElementSize * ArraySize ArraySize << log2(ElementSize) ElementSize << log2(ArraySize) Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic. Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-282-0/+38
| | | | | | | purposes for GVN/DSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85383 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful about invariance reasoning on "store" queries. Stores still ↵Owen Anderson2009-10-281-0/+15
| | | | | | | | | need to depend on Ref and ModRef calls within the invariant region. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85380 91177308-0d34-0410-b5e6-96231b3b80d8
* Add trivial support for the invariance intrinsics to memdep. This logic isOwen Anderson2009-10-281-0/+21
| | | | | | | purely local for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85378 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a pretty serious misfeature of the inliner: if it inlines a functionChris Lattner2009-10-271-1/+32
| | | | | | | | | | | | with multiple return values it inserts a PHI to merge them all together. However, if the return values are all the same, it ends up with a pointless PHI and this pointless PHI happens to really block SRoA from happening in at least a silly C++ example written by Doug, but probably others. This fixes rdar://7339069. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85206 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheck.Chris Lattner2009-10-271-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85205 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few tests to FileCheck for PR5307.Edward O'Callaghan2009-10-263-4/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85171 91177308-0d34-0410-b5e6-96231b3b80d8
* Code that checks WillNotOverflowSignedAdd before creating an AddDan Gohman2009-10-262-2/+2
| | | | | | | can safely use the NSW bit on the Add. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85164 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r85085 with a bugfix to avoid infinite looping.Chris Lattner2009-10-261-1/+0
| | | | | | | | All of the 'demorgan' related xforms need to use dyn_castNotVal, not m_Not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85119 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 85085. It causes infinite looping during llvm-gcc build.Evan Cheng2009-10-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85090 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PR3266 & PR5276, folding:Chris Lattner2009-10-262-13/+16
| | | | | | | | not (or (icmp, icmp)) -> and(icmp, icmp) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85085 91177308-0d34-0410-b5e6-96231b3b80d8
* convert or.ll to filecheck and merge or2 into it.Chris Lattner2009-10-252-71/+128
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85083 91177308-0d34-0410-b5e6-96231b3b80d8
* Make these tests more interesting by usingDan Gohman2009-10-2414-14/+14
| | | | | | | | -verify-dom-info and -verify-loop-info, which enable additional (expensive) consistency checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85017 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5287, a serious regression from my previous patches. Thanks toChris Lattner2009-10-241-24/+38
| | | | | | | Duncan for the nice tiny testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84992 91177308-0d34-0410-b5e6-96231b3b80d8
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-245-43/+4
| | | | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopDeletion check the maximum backedge taken count, rather than theDan Gohman2009-10-231-0/+27
| | | | | | | | exact backedge taken count, when checking for infinite loops. This allows it to delete loops with multiple exit conditions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84952 91177308-0d34-0410-b5e6-96231b3b80d8
* teach libanalysis to simplify vector loads with bitcast sources. ThisChris Lattner2009-10-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | implements something out of Target/README.txt producing: _foo: ## @foo movl 4(%esp), %eax movapd LCPI1_0, %xmm0 movapd %xmm0, (%eax) ret $4 instead of: _foo: ## @foo movl 4(%esp), %eax movapd _b, %xmm0 mulpd LCPI1_0, %xmm0 addpd _a, %xmm0 movapd %xmm0, (%eax) ret $4 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84942 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32 Chris Lattner2009-10-231-0/+11
| | | | | | | bytes (i256). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84941 91177308-0d34-0410-b5e6-96231b3b80d8
* teach libanalysis to fold int and fp loads from almost arbitraryChris Lattner2009-10-231-0/+68
| | | | | | | | | | | | | | | | | | | | | non-type-safe constant initializers. This sort of thing happens quite a bit for 4-byte loads out of string constants, unions, bitfields, and an interesting endianness check from sqlite, which is something like this: const int sqlite3one = 1; # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0) # define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1) # define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE) all of these macros now constant fold away. This implements PR3152 and is based on a patch started by Eli, but heavily modified and extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84936 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5262.Chris Lattner2009-10-221-1/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84810 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r84754, it isn't the right approach. Edwin, please propose Chris Lattner2009-10-211-54/+0
| | | | | | | | patches for fixes like this instead of committing them directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84799 91177308-0d34-0410-b5e6-96231b3b80d8
* Make changes to rev 84292 as requested by Chris Lattner.Victor Hernandez2009-10-211-1/+5
| | | | | | | | Most changes are cleanup, but there is 1 correctness fix: I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84772 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5262: when folding select into PHI, make sure all operands are availableTorok Edwin2009-10-212-0/+109
| | | | | | | | in the PHI's Basic Block. This uses a conservative approach, because we don't have dominator info in instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84754 91177308-0d34-0410-b5e6-96231b3b80d8
* add a real testcase for PR4313Chris Lattner2009-10-201-0/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84676 91177308-0d34-0410-b5e6-96231b3b80d8
* add a test similar to that needed for PR4313, but that doesn'tChris Lattner2009-10-201-0/+30
| | | | | | | fail without the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84675 91177308-0d34-0410-b5e6-96231b3b80d8
* the date on this testcase is wrong, it is unreduced, and it passes without ↵Chris Lattner2009-10-201-716/+0
| | | | | | the fix for PR4313. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84674 91177308-0d34-0410-b5e6-96231b3b80d8
* merge and filecheckizeChris Lattner2009-10-203-47/+67
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84672 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two tests and convert to filecheck.Chris Lattner2009-10-202-36/+46
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84671 91177308-0d34-0410-b5e6-96231b3b80d8
* alternate fix for PR5258 which avoids worklist problems, with reduced testcase.Chris Lattner2009-10-202-348/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84667 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5258, jump-threading creating invalid PHIs.Torok Edwin2009-10-201-0/+348
| | | | | | | | When an incoming value for a PHI is updated, we must also updated all other incoming values for the same BB to match, otherwise we create invalid PHIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84638 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4313: IPSCCP was not setting the lattice value for the invoke instructionTorok Edwin2009-10-201-0/+716
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84637 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SplitBlockPredecessors' LoopInfo updating code to handle the caseDan Gohman2009-10-191-0/+20
| | | | | | | | | where a loop's header is being split and it has predecessors which are not contained by the most-nested loop which contains the loop. This fixes PR5235. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84505 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a now-pointless regtestChris Lattner2009-10-181-15/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84409 91177308-0d34-0410-b5e6-96231b3b80d8
* remove testcase for dead passChris Lattner2009-10-182-16/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84406 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach vm core to more aggressively fold 'trunc' constantexprs,Chris Lattner2009-10-171-0/+18
| | | | | | | | | | | allowing it to simplify the crazy constantexprs in the testcases down to something sensible. This allows -std-compile-opts to completely "devirtualize" the pointers to member functions in the testcase from PR5176. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84368 91177308-0d34-0410-b5e6-96231b3b80d8
* remove # uses from FileCheck lines.Chris Lattner2009-10-171-14/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84367 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2009-10-171-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84364 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some code (first hunk) and fix PR5208 (second hunk) byChris Lattner2009-10-171-1/+32
| | | | | | | updating the callgraph when introducing a call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84310 91177308-0d34-0410-b5e6-96231b3b80d8
* Autoupgrade malloc insts to malloc calls.Victor Hernandez2009-10-179-12/+17
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
* HeapAllocSRoA also needs to check if malloc array size can be computed.Victor Hernandez2009-10-161-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84288 91177308-0d34-0410-b5e6-96231b3b80d8