summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: misleading comment.Andrew Trick2011-06-281-2/+2
| | | | llvm-svn: 134010
* SCEVExpander: give new insts a name that identifies the reponsible pass.Andrew Trick2011-06-283-4/+4
| | | | llvm-svn: 133992
* whitespaceAndrew Trick2011-06-281-8/+8
| | | | llvm-svn: 133991
* indvars --disable-iv-rewrite: sever ties with IVUsers.Andrew Trick2011-06-281-6/+6
| | | | llvm-svn: 133988
* indvars --disable-iv-rewrite: Defer evaluating s/zext until SCEVAndrew Trick2011-06-281-40/+57
| | | | | | evaluates all other IV exprs. llvm-svn: 133982
* indvars -disable-iv-rewrite: run RLEV after SimplifyIVUsers forAndrew Trick2011-06-271-4/+6
| | | | | | a bit more control over the order SCEVs are evaluated. llvm-svn: 133959
* Calculate GetBestDestForJumpOnUndef correctly.Jakub Staszak2011-06-271-1/+3
| | | | llvm-svn: 133946
* Teach one piece of scalarrepl to handle lifetime markers. When transforming anNick Lewycky2011-06-271-13/+37
| | | | | | | | alloca that only holds a copy of a global and we're going to replace the users of the alloca with that global, just nuke the lifetime intrinsics. Part of PR10121. llvm-svn: 133905
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-231-4/+4
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-231-4/+4
| | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. llvm-svn: 133700
* Set debug loc.Devang Patel2011-06-221-0/+2
| | | | llvm-svn: 133636
* IVUsers no longer needs to record the phis.Andrew Trick2011-06-212-12/+8
| | | | llvm-svn: 133518
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-211-4/+4
| | | | | | self-hosted build failure has been fixed (r133512). llvm-svn: 133513
* Don't use PN->replaceUsesOfWith() to change a PHINode's incoming blocks,Jay Foad2011-06-211-1/+3
| | | | | | | because it won't work after my phi operand changes, because the incoming blocks will no longer be Uses. llvm-svn: 133512
* indvars -disable-iv-rewrite: Adds support for eliminating identityAndrew Trick2011-06-211-100/+237
| | | | | | | | | | | | | | | | | | | ops. This is a rewrite of the IV simplification algorithm used by -disable-iv-rewrite. To avoid perturbing the default mode, I temporarily split the driver and created SimplifyIVUsersNoRewrite. The idea is to avoid doing opcode/pattern matching inside IndVarSimplify. SCEV already does it. We want to optimize with the full generality of SCEV, but optimize def-use chains top down on-demand rather than rewriting the entire expression bottom-up. This was easy to do for operations that SCEV can prove are identity function. So we're now eliminating bitmasks and zero extends this way. A result of this rewrite is that indvars -disable-iv-rewrite no longer requires IVUsers. llvm-svn: 133502
* Revert r133435 and r133449 to appease buildbots.Chad Rosier2011-06-211-4/+4
| | | | llvm-svn: 133499
* Completely short-circuit out ARC optimization if the ARC runtimeDan Gohman2011-06-201-4/+62
| | | | | | functions do not appear in the module. llvm-svn: 133478
* Change how PHINodes store their operands.Jay Foad2011-06-201-4/+4
| | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
* Make better use of the PHINode API.Jay Foad2011-06-202-5/+10
| | | | | | | | Change various bits of code to make better use of the existing PHINode API, to insulate them from forthcoming changes in how PHINodes store their operands. llvm-svn: 133434
* When scalar replacement returns a vector type, only accept it if the vectorCameron Zwarich2011-06-181-0/+5
| | | | | | | | | | | | type's bitwidth matches the (allocated) size of the alloca. This severely pessimizes vector scalar replacement when the only vector type being used is something like <3 x float> on x86 or ARM whose allocated size matches a <4 x float>. I hope to fix some of the flawed assumptions about allocated size throughout scalar replacement and reenable this in most cases. llvm-svn: 133338
* Fix an invalid bitcast crash that occurs when doing a partial memset of a vectorCameron Zwarich2011-06-181-3/+15
| | | | | | alloca. Fixes part of <rdar://problem/9580800>. llvm-svn: 133336
* Remove a pointless assignment. Nothing checks the value of VectorTy anymore nowCameron Zwarich2011-06-181-1/+0
| | | | | | unless ScalarKind is Vector. llvm-svn: 133335
* Fix ARCOpt to insert releases on both successors of an invoke ratherDan Gohman2011-06-161-10/+27
| | | | | | than trying to insert them immediately after the invoke. llvm-svn: 133188
* The ARC language-specific optimizer. Credit to Dan Gohman.John McCall2011-06-153-0/+3525
| | | | llvm-svn: 133108
* Stop using memdep for a check that didn't really make sense with memdep. In ↵Eli Friedman2011-06-151-11/+9
| | | | | | terms of specific issues, using memdep here checks irrelevant instructions and won't work properly once we start returning "unknown" more aggressively from memdep. llvm-svn: 133035
* Add "unknown" results for memdep, which mean "I don't know whether a ↵Eli Friedman2011-06-153-22/+37
| | | | | | dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions. llvm-svn: 133031
* Be more obvious about what is being tested.Cameron Zwarich2011-06-141-1/+2
| | | | llvm-svn: 132982
* Fix grammar.Cameron Zwarich2011-06-131-3/+3
| | | | llvm-svn: 132952
* Rename MergeInType to MergeInTypeForLoadOrStore.Cameron Zwarich2011-06-131-8/+10
| | | | llvm-svn: 132940
* Remove the HadAVector instance variable and replace it with a use of ScalarKind.Cameron Zwarich2011-06-131-15/+26
| | | | llvm-svn: 132939
* Remove a vacuous check.Cameron Zwarich2011-06-131-1/+1
| | | | llvm-svn: 132938
* Have SRoA explicitly track the kind of scalar it is promoting. This is prettyCameron Zwarich2011-06-131-10/+21
| | | | | | | | spartan right now, but I plan to encode more information in this enum to improve the correctness and reliability of SRoA. At least this first pass makes it possible to make VectorTy an actual VectorType. llvm-svn: 132937
* Remove an argument that is always true.Cameron Zwarich2011-06-131-6/+5
| | | | llvm-svn: 132936
* Remove a vacuous condition.Cameron Zwarich2011-06-091-3/+1
| | | | llvm-svn: 132767
* Fix PR10104 by adding a bounds check on a vector element access check. It wasCameron Zwarich2011-06-091-1/+4
| | | | | | | | assuming that all offsets are legal vector accesses, and thus trying to access the float member of { <2 x float>, float } as the 3rd element of the first member. llvm-svn: 132766
* Fix an assymmetry between ConvertScalar_ExtractValue and ↵Cameron Zwarich2011-06-081-3/+4
| | | | | | | | | | ConvertScalar_InsertValue. The former was using the size of the entire alloca, whereas the latter was correctly using the allocated size of the immediate type being converted (which may differ from the size of the alloca). This fixes PR10082. llvm-svn: 132759
* Use IRBuilder, preserve line numbers.Devang Patel2011-06-031-4/+6
| | | | llvm-svn: 132578
* Bail on unswitching a switch statement for a case with a critical edge. We nameNick Lewycky2011-06-031-1/+5
| | | | | | | which edge to split by pred/succ pair, which means that we can end up splitting the wrong edge (by case value) in the switch statement entirely. Fixes PR10031! llvm-svn: 132535
* Preserve line number information while converting Invoke into a Call.Devang Patel2011-06-021-0/+1
| | | | llvm-svn: 132505
* PR10067: Add missing safety check to call return transformation in ↵Eli Friedman2011-06-021-4/+21
| | | | | | MemCpyOpt::processStore. If something accesses the dest of the "copy" between the call and the copy, the performCallSlotOptzn transformation is not valid. llvm-svn: 132485
* Fix warnings due to 132263; Thanks rdivacky.Nadav Rotem2011-05-291-2/+4
| | | | llvm-svn: 132285
* Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'Nadav Rotem2011-05-271-2/+2
| | | | | | code in one place. Re-apply 131534 and fix the multi-step promotion of integers. llvm-svn: 132217
* Attempt to preserve debug line info in LICM; as the comment in the code ↵Eli Friedman2011-05-271-4/+14
| | | | | | | | says, it's hard to pick good line numbers for this transformation, but something is better than nothing. rdar://9143729 llvm-svn: 132215
* Don't sink or hoist debug info instrinsics; it isn't useful. This also ↵Eli Friedman2011-05-271-3/+6
| | | | | | | | prevents LICM sinking from erasing debug intrinsics which don't dominate any exit block of the loop. rdar://9143943 . llvm-svn: 132201
* Oops, wasn't intending to commit this. Partial revert of r132194.Eli Friedman2011-05-271-6/+9
| | | | llvm-svn: 132195
* Fix a silly mistake (which trips over an assertion) in r132099. rdar://9515076Eli Friedman2011-05-271-9/+6
| | | | llvm-svn: 132194
* Fix warning about || and && without explicit grouping.Chandler Carruth2011-05-261-2/+2
| | | | | | | | This looks like it flagged an actual bug. Devang, please review. I added the parentheses that change behavior, but make the behavior more closely match commit log's intent. llvm-svn: 132165
* Do not insert anything after terminator.Devang Patel2011-05-261-1/+2
| | | | llvm-svn: 132164
* Do not move DBG_VALUE in middle of PHI nodes.Devang Patel2011-05-261-1/+4
| | | | llvm-svn: 132161
* If llvm.dbg.value and the value instruction it refers to are far apart then ↵Devang Patel2011-05-261-1/+13
| | | | | | iSel may not be able to find corresponding Node for llvm.dbg.value during DAG construction. Make iSel's life easier by removing this distance between llvm.dbg.value and its value instruction. llvm-svn: 132151
OpenPOWER on IntegriCloud