summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Inline
Commit message (Collapse)AuthorAgeFilesLines
...
* This testcase is dead. It doesn't inline even if I add the 'alwaysinline'Bill Wendling2011-09-191-23/+0
| | | | | | attribute to the @foo function. llvm-svn: 140067
* Try to eliminate the use of the 'unwind' instruction.Bill Wendling2011-09-021-1/+1
| | | | llvm-svn: 139046
* Update to new EH scheme.Bill Wendling2011-09-021-95/+34
| | | | llvm-svn: 138989
* Update to new EH scheme.Bill Wendling2011-09-019-4/+49
| | | | llvm-svn: 138928
* Auto upgrade the old EH scheme to use the new one. This is on a trial basis. IfBill Wendling2011-08-271-34/+101
| | | | | | things to disasterously over night, this can be reverted. llvm-svn: 138702
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-181-4/+6
| | | | | | | | | for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. llvm-svn: 133337
* remove parser support for the obsolete "multiple return values" syntax, whichChris Lattner2011-06-173-138/+0
| | | | | | was replaced with return of a "first class aggregate". llvm-svn: 133245
* SplitCriticalEdge can sometimes split the edge from an invoke to a landingJohn McCall2011-06-091-1/+92
| | | | | | | | | | | | pad, separating the exception and selector calls from the new lpad. Teaching it not to do that, or to properly adjust the CFG afterwards, is out of scope because it would require the other edges to the landing pad to be split as well (effectively). Instead, just recover from the most likely cases during inlining. The best long-term solution is to change the exception representation and commit to either requiring or not requiring the more complex edge-splitting logic; this is just a shorter-term hack. llvm-svn: 132799
* First, do no harm -- even if we can't find a selector for an enclosingJohn McCall2011-06-011-2/+29
| | | | | | | landing pad, forward llvm.eh.resume calls to it instead of turning them invalidly into invokes. llvm-svn: 132382
* Add the test case for phis in the outer landing pad during the inliner'sJohn McCall2011-05-301-1/+111
| | | | | | forwarding of eh.resume that I promised yesterday. llvm-svn: 132307
* Implement and document the llvm.eh.resume intrinsic, which isJohn McCall2011-05-281-13/+18
| | | | | | | | | | | | | | | | | transformed by the inliner into a branch to the enclosing landing pad (when inlined through an invoke). If not so optimized, it is lowered DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume as appropriate). Its chief advantage is that it takes both the exception value and the selector value as arguments, meaning that there is zero effort in recovering these; however, the frontend is required to pass these down, which is not actually particularly difficult. Also document the behavior of landing pads a bit better, and make it clearer that it's okay that personality functions don't always land at landing pads. This is just a fact of life. Don't write optimizations that rely on pushing things over an unwind edge. llvm-svn: 132253
* Fix the inliner to maintain the current de facto invoke semantics:John McCall2011-05-271-0/+103
| | | | | | | | | | | | | | - the selector for the landing pad must provide all available information about the handlers, filters, and cleanups within that landing pad - calls to _Unwind_Resume must be converted to branches to the enclosing lpad so as to avoid re-entering the unwinder when the lpad claimed it was going to handle the exception in some way This is quite specific to libUnwind-based unwinding. In an effort to not interfere too badly with other unwinders, and with existing hacks in frontends, this only triggers on _Unwind_Resume (not _Unwind_Resume_or_Rethrow) and does nothing with selectors if it cannot find a selector call for either lpad. llvm-svn: 132200
* Commit test change, forgotten as part of r131838.Nick Lewycky2011-05-221-1/+1
| | | | llvm-svn: 131839
* Teach the inliner to emit llvm.lifetime.start/end, to scope the local variablesNick Lewycky2011-05-221-0/+78
| | | | | | of the inlinee to the code representing the original function. llvm-svn: 131838
* relax testcase a bit.Chris Lattner2011-01-141-1/+1
| | | | llvm-svn: 123433
* when eliding a byval copy due to inlining a readonly function, we haveChris Lattner2010-12-201-0/+23
| | | | | | to make sure that the reused alloca has sufficient alignment. llvm-svn: 122236
* pull byval processing out to its own helper function.Chris Lattner2010-12-201-3/+4
| | | | llvm-svn: 122235
* fix PR8769, a miscompilation by inliner when inlining a function with a byvalChris Lattner2010-12-201-0/+24
| | | | | | | | argument. The generated alloca has to have at least the alignment of the byval, if not, the client may be making assumptions that the new alloca won't satisfy. llvm-svn: 122234
* merge two tests.Chris Lattner2010-12-202-30/+29
| | | | llvm-svn: 122233
* filecheckizeChris Lattner2010-12-201-2/+5
| | | | llvm-svn: 122232
* Make BasicAliasAnalysis a normal AliasAnalysis implementation whichDan Gohman2010-10-183-3/+3
| | | | | | | | | | | | does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. llvm-svn: 116720
* Fix PR7272: when inlining through a callsite with byval arguments,Duncan Sands2010-05-311-0/+24
| | | | | | | the newly created allocas may be used by inlined calls, so these need to have their tail call flags cleared. Fixes PR7272. llvm-svn: 105255
* Actually run the test. Thanks Daniel Dunbar!Nick Lewycky2010-05-131-1/+1
| | | | llvm-svn: 103720
* Add testcase for r103653.Nick Lewycky2010-05-131-0/+28
| | | | llvm-svn: 103699
* revert r102831. We already delete dead readonly calls inChris Lattner2010-05-011-1/+1
| | | | | | | other places, killing a valid transformation is not the right answer. llvm-svn: 102850
* Disable the call-deletion transformation introduced in r86975. WithoutOwen Anderson2010-05-011-1/+1
| | | | | | | | | | halting analysis, it is illegal to delete a call to a read-only function. The correct solution is almost certainly to add a "must halt" attribute and only allow deletions in its presence. XFAIL the relevant testcase for now. llvm-svn: 102831
* fix PR5009 by making CGSCCPM realize that a call was devirtualizedChris Lattner2010-05-011-0/+79
| | | | | | | if an indirect call site was removed and a direct one was added, not just if an indirect call site was modified to be direct. llvm-svn: 102830
* rename testChris Lattner2010-05-011-0/+0
| | | | llvm-svn: 102829
* Implement rdar://6295824 and PR6724 with two tiny changesChris Lattner2010-05-011-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that can have a big effect :). The first is to enable the iterative SCC passmanager juice that kicks in when the scc passmgr detects that a function pass has devirtualized a call. In this case, it will rerun all the passes it manages on the SCC, up to the iteration count limit (4). This is useful because a function pass may devirualize a call, and we want the inliner to inline it, or pruneeh to infer stuff about it, etc. The second patch is to add *all* call sites to the DevirtualizedCalls list the inliner uses. This list is about to get renamed, but the jist of this is that the inliner now reconsiders *all* inlined call sites as candidates for further inlining. The intuition is this that in cases like this: f() { g(1); } g(int x) { h(x); } We analyze this bottom up, and may decide that it isn't profitable to inline H into G. Next step, we decide that it is profitable to inline G into F, and do so, which means that F now calls H. Even though the call from G -> H may not have been profitable to inline, the call from F -> H may be (in this case because a constant allows folding etc). In my spot checks, this doesn't have a big impact on code. For example, the LLC output for 252.eon grew from 0.02% (from 317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612 to 1520964 bytes). 252.eon never iterated in the SCC Passmgr, 176.gcc iterated at most 1 time. llvm-svn: 102823
* The inliner has traditionally not considered call sitesChris Lattner2010-05-011-2/+43
| | | | | | | | | | | | | | | | | that appear due to inlining a callee as candidates for futher inlining, but a recent patch made it do this if those call sites were indirect and became direct. Unfortunately, in bizarre cases (see testcase) doing this can cause us to infinitely inline mutually recursive functions into callers not in the cycle. Fix this by keeping track of the inline history from which callsite inline candidates got inlined from. This shouldn't affect any "real world" code, but is required for a follow on patch that is coming up next. llvm-svn: 102822
* Dan recently disabled recursive inlining within a function, but weChris Lattner2010-04-302-92/+32
| | | | | | | | | | | | | | | | | | were still inlining self-recursive functions into other functions. Inlining a recursive function into itself has the potential to reduce recursion depth by a factor of 2, inlining a recursive function into something else reduces recursion depth by exactly 1. Since inlining a recursive function into something else is a weird form of loop peeling, turn this off. The deleted testcase was added by Dale in r62107, since then we're leaning towards not inlining recursive stuff ever. In any case, if we like inlining recursive stuff, it should be done within the recursive function itself to get the algorithm recursion depth win. llvm-svn: 102798
* no longer xfailChris Lattner2010-04-231-2/+1
| | | | llvm-svn: 102220
* testcase for the bug that required a patch to be reverted.Chris Lattner2010-04-231-0/+31
| | | | llvm-svn: 102195
* disable my previous inliner patch, it appears to be busting self-host.Chris Lattner2010-04-231-0/+1
| | | | llvm-svn: 102153
* The inliner was choosing to not consider call sitesChris Lattner2010-04-221-2/+30
| | | | | | | | | | that appear in the SCC as a result of inlining as candidates for inlining. Change this so that it *does* consider call sites that change from being indirect to being direct as a result of inlining. This allows it to completely "devirtualize" the testcase. llvm-svn: 102146
* add a DEBUG call so that -debug lists when CGSCCPM iterates.Chris Lattner2010-04-221-0/+29
| | | | | | | | | Fix RefreshCallGraph to use CGN->replaceCallEdge instead of hand rolling its own loop. replaceCallEdge properly maintains the reference counts of the nodes, fixing a crash exposed by the iterative callgraph stuff. llvm-svn: 102120
* Implement (but don't enable) PR6724 and rdar://6295824. In short,Chris Lattner2010-04-211-0/+23
| | | | | | | | | | | | | | | we have RefreshCallGraph detect when a function pass devirtualizes a call, and have CGSCCPassMgr iterate (up to a count) when this happens. This allows (in the example) GVN to devirtualize the call in foo, then the inliner to inline it away. This is not currently enabled because I haven't done any analysis on the (potentially substantial) code size or performance impact of doing this, and guess what, it exposes callgraph updating bugs in various passes. This is progress though, and you can play with it by passing -max-cg-scc-iterations=5 to opt. llvm-svn: 101973
* Revert r101471. For tight recursive functions which have multipleDan Gohman2010-04-211-29/+0
| | | | | | | | | recursive callsites, inlining can reduce the number of calls by exponential factors, as it does in MultiSource/Benchmarks/Olden/treeadd. More involved heuristics will be needed. llvm-svn: 101969
* Disable inlining of recursive calls. It can complicate tailcallelim andDan Gohman2010-04-161-0/+29
| | | | | | | dependent analyses, and increase code size, so doing it profitably would require more complex heuristics. llvm-svn: 101471
* add newlines at the end of files.Chris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100705
* Reapply r99451 with a fix to move the NoInline check to the cost functionsEric Christopher2010-03-251-0/+18
| | | | | | instead of InlineFunction. llvm-svn: 99483
* Temporarily revert this, it's causing an issue with an internal project.Eric Christopher2010-03-241-18/+0
| | | | llvm-svn: 99451
* add some accessors to callsite/callinst/invokeinst to checkChris Lattner2010-03-231-0/+18
| | | | | | | | for the noinline attribute, and make the inliner refuse to inline a call site when the call site is marked noinline even if the callee isn't. This fixes PR6682. llvm-svn: 99341
* Delete useless trailing semicolons.Dan Gohman2010-01-051-1/+1
| | | | llvm-svn: 92740
* implement a nice little efficiency hack in the inliner. Since we're nowChris Lattner2009-11-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | running IPSCCP early, and we run functionattrs interlaced with the inliner, we often (particularly for small or noop functions) completely propagate all of the information about a call to its call site in IPSSCP (making a call dead) and functionattrs is smart enough to realize that the function is readonly (because it is interlaced with inliner). To improve compile time and make the inliner threshold more accurate, realize that we don't have to inline dead readonly function calls. Instead, just delete the call. This happens all the time for C++ codes, here are some counters from opt/llvm-ld counting the number of times calls were deleted vs inlined on various apps: Tramp3d opt: 5033 inline - Number of call sites deleted, not inlined 24596 inline - Number of functions inlined llvm-ld: 667 inline - Number of functions deleted because all callers found 699 inline - Number of functions inlined 483.xalancbmk opt: 8096 inline - Number of call sites deleted, not inlined 62528 inline - Number of functions inlined llvm-ld: 217 inline - Number of allocas merged together 2158 inline - Number of functions inlined 471.omnetpp: 331 inline - Number of call sites deleted, not inlined 8981 inline - Number of functions inlined llvm-ld: 171 inline - Number of functions deleted because all callers found 629 inline - Number of functions inlined Deleting a call is much faster than inlining it, and is insensitive to the size of the callee. :) llvm-svn: 86975
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-031-0/+1
| | | | | | depend on target data to supply it within the test llvm-svn: 85900
* 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
* Make these tests more interesting by usingDan Gohman2009-10-241-1/+1
| | | | | | | -verify-dom-info and -verify-loop-info, which enable additional (expensive) consistency checks. llvm-svn: 85017
* 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
OpenPOWER on IntegriCloud