summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix warning.Daniel Dunbar2008-10-311-1/+1
| | | | llvm-svn: 58486
* Canonicalize sext(i1) to i1?-1:0, and update various instcombineDan Gohman2008-10-301-40/+91
| | | | | | optimizations accordingly. llvm-svn: 58457
* Add InlineCost class for represent the estimated cost of inlining aDaniel Dunbar2008-10-305-15/+43
| | | | | | | | | function. - This explicitly models the costs for functions which should "always" or "never" be inlined. This fixes bugs where such costs were not previously respected. llvm-svn: 58450
* Fix PR2967 by not deleting volatile load/stores that occur before unreachable.Chris Lattner2008-10-291-0/+11
| | | | | | | I don't really see this as being needed, but there is little harm from doing it. llvm-svn: 58385
* Factor shouldInline method out of Inliner.Daniel Dunbar2008-10-291-18/+26
| | | | | | - No functionality change. llvm-svn: 58355
* Assorted comment/naming fixes, 80-col violations, and reindentation.Daniel Dunbar2008-10-282-12/+11
| | | | | | - No functionality change. llvm-svn: 58352
* (A & sext(C)) | (B & ~sext(C) -> C ? A : BDan Gohman2008-10-281-0/+19
| | | | llvm-svn: 58351
* export an ID for the instructionNamer, allowing analysis/transformation passesTorok Edwin2008-10-271-0/+1
| | | | | | that need it to require it by ID. llvm-svn: 58238
* Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power ofChris Lattner2008-10-271-175/+97
| | | | | | | | | | | | | | | | LargeBlockInfo, we can now dramatically simplify their implementation and speed them up at the same time. Now the code has time proportional to the number of uses of the alloca, not the size of the block. This also eliminates code that tried to batch up different allocas which are used in the same blocks, and eliminates the 'retry list' logic which was baroque and no unneccesary. In addition to being a speedup for crazy cases, this is also a nice cleanup: PromoteMemoryToRegister.cpp | 270 +++++++++++++++----------------------------- 1 file changed, 96 insertions(+), 174 deletions(-) llvm-svn: 58229
* Add a new LargeBlockInfo helper, which is just a wrapper aroundChris Lattner2008-10-271-57/+123
| | | | | | | | | a trivial dense map. Use this in RewriteSingleStoreAlloca to avoid aggressively rescanning blocks over and over again. This fixes PR2925, speeding up mem2reg on the testcase in that bug from 4.56s to 0.02s in a debug build on my machine. llvm-svn: 58227
* Add value range analyzing of Add and Sub.Nick Lewycky2008-10-241-9/+73
| | | | | | Understand that mul %x, 1 = %x. llvm-svn: 58069
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-229-9/+9
| | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. llvm-svn: 58010
* Use Function::getEntryBlock() instead of Function::front(), for clarity.Dan Gohman2008-10-211-1/+1
| | | | llvm-svn: 57870
* Fix a bug that prevented llvm-extract -delete from working.Dan Gohman2008-10-211-1/+1
| | | | llvm-svn: 57864
* Use 0 instead of false to return a null pointer.Dan Gohman2008-10-171-1/+1
| | | | llvm-svn: 57660
* Teach instcombine's visitLoad to scan back several instructionsDan Gohman2008-10-151-10/+46
| | | | | | | | | | | | | | to find opportunities for store-to-load forwarding or load CSE, in the same way that visitStore scans back to do DSE. Also, define a new helper function for testing whether the addresses of two memory accesses are known to have the same value, and use it in both visitStore and visitLoad. These two changes allow instcombine to eliminate loads in code produced by front-ends that frequently emit obviously redundant addressing for memory references. llvm-svn: 57608
* Combine (fcmp cc0 x, y) | (fcmp cc1 x, y) into a single fcmp when possible.Evan Cheng2008-10-141-1/+41
| | | | llvm-svn: 57515
* - Somehow I forgot about one / une.Evan Cheng2008-10-141-9/+21
| | | | | | | - Renumber fcmp predicates to match their icmp counterparts. - Try swapping operands to expose more optimization opportunities. llvm-svn: 57513
* Optimize anding of two fcmp into a single fcmp if the operands are the same. ↵Evan Cheng2008-10-141-3/+111
| | | | | | | | | e.g. uno && ueq -> ueq ord && olt -> olt ord && ueq -> oeq llvm-svn: 57507
* Make InstructionCombining::getBitCastOperand() recognize GEP instructions andMatthijs Kooijman2008-10-131-3/+23
| | | | | | constant expression with all zero indices as being the same as a bitcast. llvm-svn: 57442
* Fix PR2697 by rewriting the '(X / pos) op neg' logic. This also changesChris Lattner2008-10-111-10/+15
| | | | | | | | a couple other cases for clarity, but shouldn't affect correctness. Patch by Eli Friedman! llvm-svn: 57387
* Check loop exit predicate properly while eliminating one iteration loop.Devang Patel2008-10-101-13/+15
| | | | | | This patch fixes PR 2869 llvm-svn: 57369
* fix memleak by cleaning the global sets on pass exitNuno Lopes2008-10-101-11/+17
| | | | llvm-svn: 57353
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-1/+3
| | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
* Don't drop alignment on globals when cloning.Nick Lewycky2008-10-091-5/+9
| | | | llvm-svn: 57320
* dont specialize weak functions and the likeNuno Lopes2008-10-081-1/+1
| | | | llvm-svn: 57305
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-082-0/+2
| | | | | | Patch by Samuel Tardieu. llvm-svn: 57291
* Add parentheses to avoid warnings in GCC 4.4.0,Chris Lattner2008-10-081-1/+1
| | | | | | patch by Samuel Tardieu! llvm-svn: 57288
* Correctly set attributes when removing args during cloning. Fixes PR2765Andrew Lenharth2008-10-071-1/+17
| | | | llvm-svn: 57254
* Fix typo, fix PR 2865.Devang Patel2008-10-061-2/+2
| | | | llvm-svn: 57221
* Allow scalarrepl to treat an all-zero GEP just as bitcast.Matthijs Kooijman2008-10-061-14/+28
| | | | | | | This includes not marking a GEP involving a vector as unsafe, but only when it has all zero indices. This allows scalarrepl to work in a few more cases. llvm-svn: 57177
* rewrite bswap matching to be more general, allowing arbitraryChris Lattner2008-10-051-77/+121
| | | | | | | | shifting and masking inside a bswap expr. This allows it to handle the cases from PR2842, which involve the intermediate 'or' expressions being shifted, not just the input value. llvm-svn: 57095
* fix a bug where the bswap matcher could match a case involvingChris Lattner2008-10-051-1/+4
| | | | | | ashr. It should only apply to lshr. llvm-svn: 57089
* Ignore loads from and stores to local memory (i.e. allocas)Duncan Sands2008-10-041-9/+26
| | | | | | | | when deciding whether to mark a function readnone/readonly. Since the pass is currently run before SROA, this may be quite helpful. Requested by Chris on IRC. llvm-svn: 57050
* Clean up some multiple-return-value code that is no longerDan Gohman2008-10-031-5/+1
| | | | | | applicable. llvm-svn: 57033
* Nick Lewycky's patch.Devang Patel2008-10-031-1/+1
| | | | | | While hosting instruction check PHI node. llvm-svn: 57025
* Teach internalize to preserve the callgraph.Duncan Sands2008-10-031-0/+7
| | | | | | Why? Because it was there! llvm-svn: 56996
* SplitBlock should only attempt to update LoopInfo if it is actually being used.Owen Anderson2008-10-031-4/+3
| | | | llvm-svn: 56994
* Factorize code: remove variants of "strip offDuncan Sands2008-10-013-72/+18
| | | | | | | | | | | pointer bitcasts and GEP's", and centralize the logic in Value::getUnderlyingObject. The difference with stripPointerCasts is that stripPointerCasts only strips GEPs if all indices are zero, while getUnderlyingObject strips GEPs no matter what the indices are. llvm-svn: 56922
* revert the addition of Preverves(CallGraph), per Duncan's commentsNuno Lopes2008-10-011-2/+0
| | | | llvm-svn: 56917
* Call ScalarEvolution's deleteValueFromRecords before deleting anDan Gohman2008-10-011-3/+3
| | | | | | instruction, not after. This fixes some uses of free'd memory. llvm-svn: 56908
* add preserversCFG() + preservers(CallGraph)Nuno Lopes2008-09-301-0/+6
| | | | llvm-svn: 56887
* add AU.setPreservesCFG() since this pass only adds and removes function ↵Nuno Lopes2008-09-301-0/+5
| | | | | | attributes llvm-svn: 56868
* Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))Nick Lewycky2008-09-301-2/+3
| | | | llvm-svn: 56834
* Speed up these passes when the callgraph hasDuncan Sands2008-09-292-4/+16
| | | | | | | huge simply connected components. Suggested by Chris. llvm-svn: 56787
* remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)Nuno Lopes2008-09-291-1/+1
| | | | llvm-svn: 56786
* Tweak some comments.Duncan Sands2008-09-291-4/+6
| | | | llvm-svn: 56784
* Rename isWeakForLinker to mayBeOverridden. Use itDuncan Sands2008-09-294-8/+12
| | | | | | | instead of hasWeakLinkage in a bunch of optimization passes. llvm-svn: 56782
* Implement function notes as function attributes. Devang Patel2008-09-265-5/+6
| | | | llvm-svn: 56716
* Now Attributes are divided in three groupsDevang Patel2008-09-266-28/+61
| | | | | | | | | | | | | - return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. llvm-svn: 56704
OpenPOWER on IntegriCloud