summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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. llvm-svn: 85670
* 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. llvm-svn: 85667
* Add a testcase for the recent duplicate PHI elimination changes.Dan Gohman2009-10-301-0/+21
| | | | llvm-svn: 85636
* 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. llvm-svn: 85627
* 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. llvm-svn: 85421
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-282-0/+38
| | | | | | purposes for GVN/DSE. llvm-svn: 85383
* 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. llvm-svn: 85380
* Add trivial support for the invariance intrinsics to memdep. This logic isOwen Anderson2009-10-281-0/+21
| | | | | | purely local for now. llvm-svn: 85378
* 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. llvm-svn: 85206
* convert to filecheck.Chris Lattner2009-10-271-5/+8
| | | | llvm-svn: 85205
* Convert a few tests to FileCheck for PR5307.Edward O'Callaghan2009-10-263-4/+33
| | | | llvm-svn: 85171
* Code that checks WillNotOverflowSignedAdd before creating an AddDan Gohman2009-10-262-2/+2
| | | | | | can safely use the NSW bit on the Add. llvm-svn: 85164
* 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. llvm-svn: 85119
* Revert 85085. It causes infinite looping during llvm-gcc build.Evan Cheng2009-10-261-0/+1
| | | | llvm-svn: 85090
* Implement PR3266 & PR5276, folding:Chris Lattner2009-10-262-13/+16
| | | | | | not (or (icmp, icmp)) -> and(icmp, icmp) llvm-svn: 85085
* convert or.ll to filecheck and merge or2 into it.Chris Lattner2009-10-252-71/+128
| | | | llvm-svn: 85083
* 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. llvm-svn: 85017
* fix PR5287, a serious regression from my previous patches. Thanks toChris Lattner2009-10-241-24/+38
| | | | | | Duncan for the nice tiny testcase. llvm-svn: 84992
* 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. llvm-svn: 84987
* 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. llvm-svn: 84952
* 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 llvm-svn: 84942
* enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32 Chris Lattner2009-10-231-0/+11
| | | | | | bytes (i256). llvm-svn: 84941
* 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. llvm-svn: 84936
* fix PR5262.Chris Lattner2009-10-221-1/+27
| | | | llvm-svn: 84810
* 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. llvm-svn: 84799
* 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). llvm-svn: 84772
* 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. llvm-svn: 84754
* add a real testcase for PR4313Chris Lattner2009-10-201-0/+32
| | | | llvm-svn: 84676
* add a test similar to that needed for PR4313, but that doesn'tChris Lattner2009-10-201-0/+30
| | | | | | fail without the patch. llvm-svn: 84675
* the date on this testcase is wrong, it is unreduced, and it passes without ↵Chris Lattner2009-10-201-716/+0
| | | | | | the fix for PR4313. llvm-svn: 84674
* merge and filecheckizeChris Lattner2009-10-203-47/+67
| | | | llvm-svn: 84672
* merge two tests and convert to filecheck.Chris Lattner2009-10-202-36/+46
| | | | llvm-svn: 84671
* alternate fix for PR5258 which avoids worklist problems, with reduced testcase.Chris Lattner2009-10-202-348/+35
| | | | llvm-svn: 84667
* 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. llvm-svn: 84638
* 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. llvm-svn: 84637
* 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. llvm-svn: 84505
* remove a now-pointless regtestChris Lattner2009-10-181-15/+0
| | | | llvm-svn: 84409
* remove testcase for dead passChris Lattner2009-10-182-16/+0
| | | | llvm-svn: 84406
* 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. llvm-svn: 84368
* remove # uses from FileCheck lines.Chris Lattner2009-10-171-14/+15
| | | | llvm-svn: 84367
* rename testChris Lattner2009-10-171-0/+0
| | | | llvm-svn: 84364
* Simplify some code (first hunk) and fix PR5208 (second hunk) byChris Lattner2009-10-171-1/+32
| | | | | | updating the callgraph when introducing a call. llvm-svn: 84310
* 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. llvm-svn: 84292
* HeapAllocSRoA also needs to check if malloc array size can be computed.Victor Hernandez2009-10-161-0/+26
| | | | llvm-svn: 84288
* Invert isSafeToGetMallocArraySize check because we return NULL when we don't ↵Victor Hernandez2009-10-161-0/+30
| | | | | | | | know the size. Thanks to Duncan Sands for noticing this bug. llvm-svn: 84260
* Check that GVN performs this transform even if the callsDuncan Sands2009-10-161-14/+14
| | | | | | | themselves are not marked readonly, but only the called functions. llvm-svn: 84253
* make instcombine's instruction sinking more aggressive in theChris Lattner2009-10-141-1/+37
| | | | | | presence of PHI nodes. llvm-svn: 84103
* change simplifycfg to not duplicate 'unwind' instructions. HopefullyChris Lattner2009-10-131-3/+18
| | | | | | | this will increase the likelihood of common code getting sunk towards the unwind. llvm-svn: 83996
* convert to filecheckChris Lattner2009-10-131-5/+5
| | | | llvm-svn: 83995
* rename testChris Lattner2009-10-131-0/+0
| | | | llvm-svn: 83994
OpenPOWER on IntegriCloud