summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement the first half of Transforms/Inline/inline_cleanup.llChris Lattner2006-09-131-1/+9
| | | | llvm-svn: 30303
* silence warnings in a release buildChris Lattner2006-07-181-1/+1
| | | | llvm-svn: 29189
* Handle instructions in the map, but that map to a null pointer.Chris Lattner2006-07-121-1/+2
| | | | | | This unbreaks smg2000. llvm-svn: 29127
* In addition to deleting calls, the inliner can constant fold them as well.Chris Lattner2006-07-121-2/+4
| | | | | | | Handle this case, which doesn't require a new callgraph edge. This fixes a crash compiling MallocBench/gs. llvm-svn: 29121
* Change the callgraph representation to store the callsite along with theChris Lattner2006-07-121-37/+46
| | | | | | | | | | | target CG node. This allows the inliner to properly update the callgraph when using the pruning inliner. The pruning inliner may not copy over all call sites from a callee to a caller, so the edges corresponding to those call sites should not be copied over either. This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll llvm-svn: 29120
* Switch the inliner over to using CloneAndPruneFunctionInto. This effectivelyChris Lattner2006-05-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | makes it so that it constant folds instructions on the fly. This is good for several reasons: 0. Many instructions are constant foldable after inlining, particularly if inlining a call with constant arguments. 1. Without this, the inliner has to allocate memory for all of the instructions that can be constant folded, then a subsequent pass has to delete them. This gets the job done without this extra work. 2. This makes the inliner *pass* a bit more aggressive: in particular, it partially solves a phase order issue where the inliner would inline lots of code that folds away to nothing, but think that the resultant function is big because of this code that will be gone. Now the code never exists. This is the first part of a 2-step process. The second part will be smart enough to see when this implicit constant folding propagates a constant into a branch or switch instruction, making CFG edges dead. This implements Transforms/Inline/inline_constprop.ll llvm-svn: 28521
* Teach the inliner to update the CallGraph itself, and have it add edges toChris Lattner2006-01-141-4/+53
| | | | | | llvm.stacksave/restore when it inserts calls to them. llvm-svn: 25320
* If inlining a call to a function that contains dynamic allocas, wrap theChris Lattner2006-01-131-0/+30
| | | | | | resultant code with llvm.stacksave/llvm.stackrestore intrinsics. llvm-svn: 25286
* Use ClonedCodeInfo to avoid another walk over the inlined code, this thisChris Lattner2006-01-131-2/+4
| | | | | | time in common C cases. llvm-svn: 25285
* Use the ClonedCodeInfo object to avoid scans of the inlined code whenChris Lattner2006-01-131-62/+67
| | | | | | | it doesn't contain any calls. This is a fairly common case for C++ code, so it will probably speed up the inliner marginally in these cases. llvm-svn: 25284
* Refactor a bunch of invoke handling stuff out into a new functionChris Lattner2006-01-131-88/+108
| | | | | | "HandleInlinedInvoke". No functionality change. llvm-svn: 25283
* Fix a bug I noticed by inspection: if the first instruction in the inlinedChris Lattner2006-01-131-5/+3
| | | | | | | | function was not an alloca, we wouldn't check the entry block for any allocas, leading to increased stack space in some cases. In practice, allocas are almost always at the top of the block, so this was never noticed. llvm-svn: 25280
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-271-1/+1
| | | | llvm-svn: 22523
* wrap long lines, preserve calling conventions when cloning functions andChris Lattner2005-05-091-0/+1
| | | | | | turning calls into invokes llvm-svn: 21797
* BAD typeo which caused many testsuite failures last night. Note to self, doChris Lattner2005-05-061-1/+1
| | | | | | not change code after testing it without retesting! llvm-svn: 21741
* Implement Transforms/Inline/inline-tail.llChris Lattner2005-05-061-1/+16
| | | | llvm-svn: 21736
* Remove trailing whitespaceMisha Brukman2005-04-211-29/+29
| | | | llvm-svn: 21427
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-151-3/+3
| | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
* The split bb is really the exit of the old functionChris Lattner2004-12-111-2/+2
| | | | llvm-svn: 18799
* Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.llChris Lattner2004-10-171-4/+8
| | | | | | | If a function had no return instruction in it, and the result of the inlined call instruction was used, we would crash. llvm-svn: 17104
* Convert code to compile with vc7.1.Reid Spencer2004-09-151-4/+9
| | | | | | Patch contributed by Paolo Invernizzi. Thanks Paolo! llvm-svn: 16368
* Fix a serious code pessimization problem. If an inlined function has a singleChris Lattner2004-07-201-5/+6
| | | | | | | return, clone the 'ret' BB code into the block AFTER the inlined call, not the other way around. llvm-svn: 15030
* Fix Inline/2004-04-15-InlineDeletesCall.llChris Lattner2004-04-161-12/+20
| | | | | | | | Basically we were using SimplifyCFG as a huge sledgehammer for a simple optimization. Because simplifycfg does so many things, we can't use it for this purpose. llvm-svn: 12977
* Fix compilation of 126.gcc: intrinsic functions cannot throw, so they are notChris Lattner2004-02-131-28/+33
| | | | | | | allowed in invoke instructions. Thus, if we are inlining a call to an intrinsic function into an invoke site, we don't need to turn the call into an invoke! llvm-svn: 11384
* rename the "exceptional" destination of an invoke instruction to the ↵Chris Lattner2004-02-081-1/+1
| | | | | | 'unwind' dest llvm-svn: 11202
* Two changes:Chris Lattner2004-02-041-5/+12
| | | | | | | | | | | | | 1. Don't scan to the end of alloca instructions in the caller function to insert inlined allocas, just insert at the top. This saves a lot of time inlining into functions with a lot of allocas. 2. Use splice to move the alloca instructions over, instead of remove/insert. This allows us to transfer a block at a time, and eliminates a bunch of silly symbol table manipulations. This speeds up the inliner on the testcase in PR209 from 1.73s -> 1.04s (67%) llvm-svn: 11118
* Optimize the case where we are inlining a function that contains only one ↵Chris Lattner2004-02-041-37/+67
| | | | | | | | | | | basic block, and that basic block ends with a return instruction. In this case, we can just splice the cloned "body" of the function directly into the source basic block, avoiding a lot of rearrangement and splitBasicBlock's linear scan over the split block. This speeds up the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction. llvm-svn: 11116
* More refactoring. Move alloca instructions and handle invoke instructionsChris Lattner2004-02-041-129/+132
| | | | | | | before we delete the original call site, allowing slight simplifications of code, but nothing exciting. llvm-svn: 11109
* Move the cloning of the function body much earlier in the inlinefunctionChris Lattner2004-02-041-52/+54
| | | | | | | | | | process. The only optimization we did so far is to avoid creating a PHI node, then immediately destroying it in the common case where the callee has one return statement. Instead, we just don't create the return value. This has no noticable performance impact, but paves the way for future improvements. llvm-svn: 11108
* Finegrainify namespacificationChris Lattner2004-01-091-7/+4
| | | | llvm-svn: 10727
* Start using the nicer terminator auto-insertion APIChris Lattner2003-11-201-1/+1
| | | | llvm-svn: 10111
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | llvm-svn: 9903
* Get the list of PHI node values before the basic block is split. Also, addChris Lattner2003-10-271-9/+16
| | | | | | | | PHI node entries for unwind instructions just like for call instructions which became invokes! This fixes PR57, tested by Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll llvm-svn: 9526
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* Do not move variable sized allocations to the top of the caller, which mightChris Lattner2003-10-141-7/+5
| | | | | | | | break dominance relationships, and is otherwise bad. This fixes bug: Inline/2003-10-13-AllocaDominanceProblem.ll. This also fixes miscompilation of 3 176.gcc source files (reload1.c, global.c, flow.c) llvm-svn: 9109
* Avoid doing pointless work. Amazingly, this makes us go faster.Chris Lattner2003-10-061-8/+0
| | | | | | | | | | Running the inliner on 252.eon used to take 48.4763s, now it takes 14.4148s. In release mode, it went from taking 25.8741s to taking 11.5712s. This also fixes a FIXME. llvm-svn: 8890
* Fix bugs in the last changeChris Lattner2003-09-221-2/+2
| | | | llvm-svn: 8667
* Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.llChris Lattner2003-09-221-2/+7
| | | | llvm-svn: 8666
* Fix bug: Inline/2003-09-22-PHINodesInExceptionDest.llChris Lattner2003-09-221-1/+28
| | | | | | | ... by making sure to update PHI nodes to take into consideration the extra edges we get if we inline a call instruction through an invoke. llvm-svn: 8664
* Fix bug: Inline/2003-09-14-InlineValue.llChris Lattner2003-09-151-4/+8
| | | | llvm-svn: 8514
* Eliminate support for the llvm.unwind intrinisic, using the Unwind ↵Chris Lattner2003-09-081-27/+14
| | | | | | instruction instead llvm-svn: 8411
* Should invokify is always trueChris Lattner2003-09-081-24/+16
| | | | llvm-svn: 8409
* Remove special casingChris Lattner2003-08-251-3/+0
| | | | llvm-svn: 8144
* rethrow is really the language independent primitive here. "throw" can be ↵Chris Lattner2003-08-241-7/+7
| | | | | | | | | written in terms of it and llvm.exc.setcurrent. Rework the intrinsics. llvm-svn: 8111
* *** Implement inlining of Invoke instructions!Chris Lattner2003-08-241-51/+138
| | | | llvm-svn: 8106
* Implement: Inline/cfg_preserve_test.llChris Lattner2003-08-241-2/+15
| | | | llvm-svn: 8099
* * Separate all of the grunt work of inlining out into the Utils library.Chris Lattner2003-05-291-0/+164
* Make the function inliner _significantly_ smarter. :) llvm-svn: 6396
OpenPOWER on IntegriCloud