summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Restore optimization that merges blocks when inline function Devang Patel2008-03-101-6/+24
| | | | | | has single return value. llvm-svn: 48162
* SimplifyDevang Patel2008-03-101-18/+15
| | | | llvm-svn: 48161
* Update the inliner and simplifycfg to handle unwind_to.Nick Lewycky2008-03-091-0/+13
| | | | llvm-svn: 48086
* Update inliner to handle functions that return multiple values.Devang Patel2008-03-071-43/+52
| | | | llvm-svn: 48020
* Use while loop.Devang Patel2008-03-041-3/+2
| | | | llvm-svn: 47909
* Use cast instead of dyn_cast.Devang Patel2008-03-041-2/+1
| | | | | | Update test to use multiple return value directly, instead of relying on -sretpromotion. llvm-svn: 47907
* Handle multiple return values.Devang Patel2008-03-041-3/+15
| | | | llvm-svn: 47904
* Revert r46393: readonly/readnone functions are noDuncan Sands2008-01-271-9/+6
| | | | | | longer allowed to write through byval arguments. llvm-svn: 46416
* Create an explicit copy for byval parameters evenDuncan Sands2008-01-261-6/+9
| | | | | | when inlining a readonly function. llvm-svn: 46393
* Do this more neatly.Duncan Sands2008-01-251-2/+1
| | | | llvm-svn: 46369
* we don't have to make an explicit copy of a byval argument when Chris Lattner2008-01-121-4/+6
| | | | | | | inlining a function if we know that the function does not write to *any* memory. This implements test/Transforms/Inline/byval2.ll llvm-svn: 45912
* When inlining a functino with a byval argument, make an explicit Chris Lattner2008-01-111-6/+57
| | | | | | copy of it in case the callee modifies the struct. llvm-svn: 45853
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* GC poses hazards to the inliner. Consider:Gordon Henriksen2007-12-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | define void @f() { ... call i32 @g() ... } define void @g() { ... } The hazards are: - @f and @g have GC, but they differ GC. Inlining is invalid. This may never occur. - @f has no GC, but @g does. g's GC must be propagated to @f. The other scenarios are safe: - @f and @g have the same GC. - @f and @g have no GC. - @g has no GC. This patch adds inliner checks for the former two scenarios. llvm-svn: 45351
* When inlining through an 'nounwind' call, mark inlinedDuncan Sands2007-12-191-5/+27
| | | | | | | | | calls 'nounwind'. It is important for correct C++ exception handling that nounwind markings do not get lost, so this transformation is actually needed for correctness. llvm-svn: 45218
* Rename isNoReturn to doesNotReturn, and isNoUnwind toDuncan Sands2007-12-181-1/+1
| | | | | | doesNotThrow. llvm-svn: 45160
* Make invokes of inline asm legal. Teach codegenDuncan Sands2007-12-171-3/+2
| | | | | | | | how to lower them (with no attempt made to be efficient, since they should only occur for unoptimized code). llvm-svn: 45108
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-1/+1
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Revert this part of r45073 until the verifier isDuncan Sands2007-12-161-2/+3
| | | | | | changed not to reject invoke of inline asm. llvm-svn: 45077
* Make instcombine promote inline asm calls to 'nounwind'Duncan Sands2007-12-161-3/+2
| | | | | | | | | | | | | calls. Remove special casing of inline asm from the inliner. There is a potential problem: the verifier rejects invokes of inline asm (not sure why). If an asm call is not marked "nounwind" in some .ll, and instcombine is not run, but the inliner is run, then an illegal module will be created. This is bad but I'm not sure what the best approach is. I'm tempted to remove the check in the verifier... llvm-svn: 45073
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-5/+3
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-0/+1
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* Update InvokeInst to work like CallInstDavid Greene2007-08-271-1/+1
| | | | llvm-svn: 41506
* Fix PR1335 and Transforms/Inline/2007-04-15-InlineEH.llChris Lattner2007-04-151-4/+5
| | | | llvm-svn: 36090
* Change uses of Function::front to Function::getEntryBlock for readability.Dan Gohman2007-03-221-3/+4
| | | | llvm-svn: 35265
* Fix typos in comments.Dan Gohman2007-02-201-1/+1
| | | | llvm-svn: 34456
* Eliminate use of ctors that take vectors.Chris Lattner2007-02-131-1/+3
| | | | llvm-svn: 34219
* Switch inliner over to use DenseMap instead of std::map for ValueMap. ThisChris Lattner2007-02-031-3/+3
| | | | | | speeds up the inliner 16%. llvm-svn: 33801
* The inliner/cloner can now optionally take TargetData info, which can beChris Lattner2007-01-301-6/+6
| | | | | | used by constant folding. llvm-svn: 33676
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-1/+1
| | | | | | confusion with external linkage types. llvm-svn: 33663
* prepare for adjustment to getOrInsertFunction methodChris Lattner2007-01-071-6/+8
| | | | llvm-svn: 32985
* For PR950:Reid Spencer2006-12-311-1/+1
| | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
* 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
OpenPOWER on IntegriCloud