| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 45418
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
doesNotThrow.
llvm-svn: 45160
|
|
|
|
|
|
|
|
| |
how to lower them (with no attempt made to be
efficient, since they should only occur for
unoptimized code).
llvm-svn: 45108
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
changed not to reject invoke of inline asm.
llvm-svn: 45077
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 41506
|
|
|
|
| |
llvm-svn: 36090
|
|
|
|
| |
llvm-svn: 35265
|
|
|
|
| |
llvm-svn: 34456
|
|
|
|
| |
llvm-svn: 34219
|
|
|
|
|
|
| |
speeds up the inliner 16%.
llvm-svn: 33801
|
|
|
|
|
|
| |
used by constant folding.
llvm-svn: 33676
|
|
|
|
|
|
| |
confusion with external linkage types.
llvm-svn: 33663
|
|
|
|
| |
llvm-svn: 32985
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 30303
|
|
|
|
| |
llvm-svn: 29189
|
|
|
|
|
|
| |
This unbreaks smg2000.
llvm-svn: 29127
|
|
|
|
|
|
|
| |
Handle this case, which doesn't require a new callgraph edge. This fixes
a crash compiling MallocBench/gs.
llvm-svn: 29121
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
llvm.stacksave/restore when it inserts calls to them.
llvm-svn: 25320
|
|
|
|
|
|
| |
resultant code with llvm.stacksave/llvm.stackrestore intrinsics.
llvm-svn: 25286
|
|
|
|
|
|
| |
time in common C cases.
llvm-svn: 25285
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
"HandleInlinedInvoke". No functionality change.
llvm-svn: 25283
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 22523
|
|
|
|
|
|
| |
turning calls into invokes
llvm-svn: 21797
|
|
|
|
|
|
| |
not change code after testing it without retesting!
llvm-svn: 21741
|
|
|
|
| |
llvm-svn: 21736
|
|
|
|
| |
llvm-svn: 21427
|
|
|
|
|
|
|
|
| |
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
|
|
|
|
| |
llvm-svn: 18799
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch contributed by Paolo Invernizzi. Thanks Paolo!
llvm-svn: 16368
|
|
|
|
|
|
|
| |
return, clone the 'ret' BB code into the block AFTER the inlined call, not the
other way around.
llvm-svn: 15030
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
'unwind' dest
llvm-svn: 11202
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
before we delete the original call site, allowing slight simplifications of
code, but nothing exciting.
llvm-svn: 11109
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 10727
|