summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* PR10267: Don't combine an equality compare with an AND into an inequality ↵Benjamin Kramer2011-07-041-1/+5
| | | | | | | | compare when the AND has more than one use. This can pessimize code, inequalities are generally more expensive. llvm-svn: 134379
* indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.Andrew Trick2011-07-021-46/+51
| | | | llvm-svn: 134306
* Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of ↵Owen Anderson2011-07-011-2/+6
| | | | | | integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly. llvm-svn: 134265
* Fix likely typo, reduce number of instruction name collisions.Nick Lewycky2011-07-011-1/+1
| | | | llvm-svn: 134235
* Add r134057 back, but splice the predecessor after the successors phiRafael Espindola2011-06-302-11/+13
| | | | | | | | | nodes. Original message: Let simplify cfg simplify bb with only debug and lifetime intrinsics. llvm-svn: 134182
* indvars -disable-iv-rewrite: handle cloning binary operators that cannot ↵Andrew Trick2011-06-301-3/+7
| | | | | | overflow. llvm-svn: 134177
* indvars -disable-iv-rewrite: handle an edge case involving identity phis.Andrew Trick2011-06-301-3/+8
| | | | llvm-svn: 134124
* indvars -disable-iv-rewrite: insert new trunc instructions carefully.Andrew Trick2011-06-291-13/+21
| | | | llvm-svn: 134112
* Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and Chad Rosier2011-06-292-13/+11
| | | | | | lifetime intrinsics" due to buildbot failures. llvm-svn: 134071
* Let simplify cfg simplify bb with only debug and lifetime intrinsics.Rafael Espindola2011-06-292-11/+13
| | | | llvm-svn: 134057
* indvars -disable-iv-rewrite: just because SCEV ignores casts doesn'tAndrew Trick2011-06-291-0/+1
| | | | | | mean they can be removed. llvm-svn: 134054
* 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
* Fix typo in comment.Nick Lewycky2011-06-281-1/+1
| | | | llvm-svn: 133990
* 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
* Move onlyUsedByLifetimeMarkers to ValueTracking so that it can be used by otherNick Lewycky2011-06-271-16/+1
| | | | | | passes as well. llvm-svn: 133904
* PR10180: Fix a instcombine crash with FP vectors.Eli Friedman2011-06-231-2/+2
| | | | llvm-svn: 133756
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-238-98/+102
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-238-102/+98
| | | | | | | | | "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
* Replace the existing forms of ConstantArray::get() with a single formJay Foad2011-06-221-2/+2
| | | | | | that takes an ArrayRef. llvm-svn: 133615
* IVUsers no longer needs to record the phis.Andrew Trick2011-06-212-12/+8
| | | | llvm-svn: 133518
* Remove unused variables.Benjamin Kramer2011-06-211-2/+2
| | | | llvm-svn: 133514
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-218-91/+95
| | | | | | 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-218-95/+91
| | | | 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-208-91/+95
| | | | | | | | | | | | | | | | | | | 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
* Revamp the "ConstantStruct::get" methods. Previously, these were scatteredChris Lattner2011-06-203-46/+52
| | | | | | | | | | | | | | | all over the place in different styles and variants. Standardize on two preferred entrypoints: one that takes a StructType and ArrayRef, and one that takes StructType and varargs. In cases where there isn't a struct type convenient, we now add a ConstantStruct::getAnon method (whose name will make more sense after a few more patches land). It would be "really really nice" if the ConstantStruct::get and ConstantVector::get methods didn't make temporary std::vectors. llvm-svn: 133412
* fix the varargs version of StructType::get to not require an LLVMContext, ↵Chris Lattner2011-06-181-1/+1
| | | | | | | | making usage much cleaner. llvm-svn: 133364
* Fix PR10103: Less code for enum type translation.Hans Wennborg2011-06-181-0/+74
| | | | | | | | | | | In cases such as the attached test, where the case value for a switch destination is used in a phi node that follows the destination, it might be better to replace that value with the condition value of the switch, so that more blocks can be folded away with TryToSimplifyUncondBranchFromEmptyBlock because there are less conflicts in the phi node. llvm-svn: 133344
* 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
* Revert r133285. Causing odd failures on Dragonegg.Chad Rosier2011-06-171-4/+5
| | | | llvm-svn: 133301
* Set debug loc for new preheader's terminator.Devang Patel2011-06-171-0/+1
| | | | llvm-svn: 133298
* Relocate NUW test to cover all binary ops in a dynamic alloca expr.Stuart Hastings2011-06-171-5/+4
| | | | | | Followup to 132926. rdar://problem/9265821 llvm-svn: 133285
* When promoting an alloca to registers discard any lifetime intrinsics.Nick Lewycky2011-06-171-0/+59
| | | | llvm-svn: 133251
* 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
* Simplify; no significant functionality change.Eli Friedman2011-06-151-26/+2
| | | | llvm-svn: 133086
* Fix cmake build.Rafael Espindola2011-06-151-1/+0
| | | | llvm-svn: 133085
* Remove unused code.Eli Friedman2011-06-151-128/+0
| | | | llvm-svn: 133078
OpenPOWER on IntegriCloud