summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Revert 96626, which causes build failure on ppc Darwin.Dale Johannesen2010-02-191-7/+0
| | | | llvm-svn: 96653
* When determining the set of interesting reuse factors, considerDan Gohman2010-02-191-9/+15
| | | | | | | | strides in foreign loops. This helps locate reuse opportunities with existing induction variables in foreign loops and reduces the need for inserting new ones. This fixes rdar://7657764. llvm-svn: 96629
* Indvars needs to explicitly notify ScalarEvolution when it is replacingDan Gohman2010-02-181-0/+7
| | | | | | | | a loop exit value, so that if a loop gets deleted, ScalarEvolution isn't stick holding on to dangling SCEVAddRecExprs for that loop. This fixes PR6339. llvm-svn: 96626
* Hoist this loop-invariant logic out of the loop.Dan Gohman2010-02-181-4/+6
| | | | llvm-svn: 96614
* Delete some unneeded casts.Dan Gohman2010-02-171-2/+2
| | | | llvm-svn: 96429
* Don't attempt to divide INT_MIN by -1; consider such cases toDan Gohman2010-02-171-0/+4
| | | | | | have overflowed. llvm-svn: 96428
* Rename SuccessorNumber to GetSuccessorNumber.Bob Wilson2010-02-162-7/+8
| | | | llvm-svn: 96387
* Refactor rewriting for PHI nodes into a separate function.Dan Gohman2010-02-161-49/+70
| | | | llvm-svn: 96382
* Split critical edges as needed for load PRE.Bob Wilson2010-02-161-8/+30
| | | | llvm-svn: 96378
* Refactor to share code to find the position of a basic block successor in theBob Wilson2010-02-162-19/+18
| | | | | | terminator's list of successors. llvm-svn: 96377
* Fix whitespace.Dan Gohman2010-02-161-3/+3
| | | | llvm-svn: 96372
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-1630-311/+311
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Split the main for-each-use loop again, this time for GenerateTruncates,Dan Gohman2010-02-161-1/+4
| | | | | | | as it also peeks at which registers are being used by other uses. This makes LSR less sensitive to use-list order. llvm-svn: 96308
* fix PR6305 by handling BlockAddress in a helper functionChris Lattner2010-02-151-0/+11
| | | | | | called by jump threading. llvm-svn: 96263
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-1520-67/+68
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Fix whitespace.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96179
* Fix a comment.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96178
* When complicated expressions are broken down into subexpressionsDan Gohman2010-02-141-2/+8
| | | | | | | | | | with multiplication by constants distributed through, occasionally those subexpressions can include both x and -x. For now, if this condition is discovered within LSR, just prune such cases away, as they won't be profitable. This fixes a "zero allocated in a base register" assertion failure. llvm-svn: 96177
* Actually, this code doesn't have to be quite so conservative inDan Gohman2010-02-141-6/+5
| | | | | | | the no-TLI case. But it should still default to declining the transformation. llvm-svn: 96152
* Don't attempt aggressive post-inc uses if TargetLowering is not available,Dan Gohman2010-02-141-3/+8
| | | | | | because profitability can't be sufficiently approximated. llvm-svn: 96148
* Make LSR not crash if invoked without target lowering info, e.g. if invokedJohn McCall2010-02-131-2/+2
| | | | | | from opt. llvm-svn: 96135
* Fix a problem where we had bitcasted operands that gave usEric Christopher2010-02-131-5/+9
| | | | | | | odd offsets since the bitcasted pointer size and the offset pointer size are going to be different types for the GEP vs base object. llvm-svn: 96134
* remove dead code.Chris Lattner2010-02-131-46/+7
| | | | llvm-svn: 96109
* Split some code out to a helper function (FindReusablePredBB)Chris Lattner2010-02-131-50/+72
| | | | | | | | | | | | and add a doxygen comment. Cache the phi entry to avoid doing tons of PHINode::getBasicBlockIndex calls in the common case. On my insane testcase from re2c, this speeds up CGP from 617.4s to 7.9s (78x). llvm-svn: 96083
* Speed up codegen prepare from 3.58s to 0.488s.Chris Lattner2010-02-131-19/+52
| | | | llvm-svn: 96081
* PHINode::getBasicBlockIndex is O(n) in the number of inputsChris Lattner2010-02-131-3/+10
| | | | | | | | to a PHI, avoid it in the common case where the BB occurs in the same index for multiple phis. This speeds up CGP on an insane testcase from 8.35 to 3.58s. llvm-svn: 96080
* iterate over preds using PHI information when available instead ofChris Lattner2010-02-131-6/+14
| | | | | | using pred_begin/end. It is much faster. llvm-svn: 96079
* speed up CGP a bit by scanning predecessors through phi operandsChris Lattner2010-02-131-22/+22
| | | | | | instead of with pred_begin/end. llvm-svn: 96078
* Fix a pruning heuristic which implicitly assumed that SmallPtrSet isDan Gohman2010-02-131-45/+68
| | | | | | deterministically sorted. llvm-svn: 96071
* Enable the inlinehint attribute in the Inliner.Jakob Stoklund Olesen2010-02-131-13/+12
| | | | | | | | | | | | | | | | | | | | Functions explicitly marked inline will get an inlining threshold slightly more aggressive than the default for -O3. This means than -O3 builds are mostly unaffected while -Os builds will be a bit bigger and faster. The difference depends entirely on how many 'inline's are sprinkled on the source. In the CINT2006 suite, only these tests are significantly affected under -Os: Size Time 471.omnetpp +1.63% -1.85% 473.astar +4.01% -6.02% 483.xalancbmk +4.60% 0.00% Note that 483.xalancbmk runs too quickly to give useful timing results. llvm-svn: 96066
* Reapply 95979, a compile-time speedup, now that the bug it exposed is fixed.Dan Gohman2010-02-121-1/+1
| | | | llvm-svn: 96005
* Fix this code to avoid dereferencing an end() iterator inDan Gohman2010-02-121-1/+5
| | | | | | offset distributions it doesn't expect. llvm-svn: 96002
* 1. modernize the constantmerge pass, using densemap/smallvector.Chris Lattner2010-02-121-19/+22
| | | | | | | | | 2. don't bother trying to merge globals in non-default sections, doing so is quite dubious at best anyway. 3. fix a bug reported by Arnaud de Grandmaison where we'd try to merge two globals in different address spaces. llvm-svn: 95995
* Revert "Reverse the order for collecting the parts of an addrec. The order", itDaniel Dunbar2010-02-121-1/+1
| | | | | | is breaking llvm-gcc bootstrap. llvm-svn: 95988
* Reverse the order for collecting the parts of an addrec. The orderDan Gohman2010-02-121-1/+1
| | | | | | | doesn't matter, except that ScalarEvolution tends to need less time to fold the results this way. llvm-svn: 95979
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-122-2351/+2790
| | | | | | | | | | bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. llvm-svn: 95975
* Make sure that ConstantExpr offsets also aren't off of externEric Christopher2010-02-111-2/+8
| | | | | | | | symbols. Thanks to Duncan Sands for the testcase! llvm-svn: 95877
* Rename ValueRequiresCast to ShouldOptimizeCast, to better reflectChris Lattner2010-02-113-55/+97
| | | | | | | | | | | | | | what it does. Enhance it to return false to optimizing vector sign extensions from vector comparisions, which is the idiom used to get a splatted vector for a vector comparison. Doing this breaks vector-casts.ll, add some compensating transformations to handle the important case they cover without depending on this canonicalization. This fixes rdar://7434900 a serious pessimization of vector compares. llvm-svn: 95855
* Make DSE only scan blocks that are reachable from the entryChris Lattner2010-02-111-1/+7
| | | | | | | | | block. Other blocks may have pointer cycles that will crash basicaa and other alias analyses. In any case, there is no point wasting cycles optimizing dead blocks. This fixes rdar://7635088 llvm-svn: 95852
* Make jump threading honor x|undef -> true and x&undef -> false,Chris Lattner2010-02-111-3/+8
| | | | | | instead of considering x|undef -> x, which may not be true. llvm-svn: 95850
* Add ConstantExpr handling to Intrinsic::objectsize lowering.Eric Christopher2010-02-111-1/+26
| | | | | | | Update testcase accordingly now that we can optimize another section. llvm-svn: 95846
* Ignore dbg info intrinsics.Devang Patel2010-02-111-0/+4
| | | | llvm-svn: 95828
* Strip new llvm.dbg.value intrinsic.Devang Patel2010-02-101-0/+9
| | | | llvm-svn: 95807
* Fix "the the" and similar typos.Dan Gohman2010-02-106-8/+8
| | | | llvm-svn: 95781
* Move Intrinsic::objectsize lowering back to InstCombineCalls andEric Christopher2010-02-091-1/+19
| | | | | | enable constant 0 offset lowering. llvm-svn: 95691
* Pull these back out, they're a little too aggressive and timeEric Christopher2010-02-092-115/+0
| | | | | | consuming for a simple optimization. llvm-svn: 95671
* simplify this code, duh.Chris Lattner2010-02-091-8/+4
| | | | llvm-svn: 95643
* fix PR6193, only considering sign extensions *from i1* for thisChris Lattner2010-02-091-5/+10
| | | | | | xform. llvm-svn: 95642
* Add file in here too.Eric Christopher2010-02-091-0/+1
| | | | llvm-svn: 95641
* Add a new pass to do llvm.objsize lowering using SCEV.Eric Christopher2010-02-091-0/+114
| | | | | | | | | | | Initial skeleton and SCEVUnknown lowering implemented, the rest should come relatively quickly. Move testcase to new directory. Move pass to right before SimplifyLibCalls - which is moved down a bit so we can take advantage of a few opts. llvm-svn: 95628
OpenPOWER on IntegriCloud