| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
extracted, and a function that contained a single top-level loop never had
the loop extracted, regardless of how much non-loop code there was.
llvm-svn: 12403
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Don't insert a branch to the switch instruction after the call, just
make it a single block.
* Insert the new alloca instructions in the entry block of the original
function instead of having them execute dynamically
* Don't make the default edge of the switch instruction go back to the switch.
The loop extractor shouldn't create new loops!
* Give meaningful names to the alloca slots and the reload instructions
* Some minor code simplifications
llvm-svn: 12402
|
| |
|
|
|
|
|
|
|
|
| |
This also implements a two minor improvements:
* Don't insert live-out stores IN the region, insert them on the code path
that exits the region
* If the region is exited to the same block from multiple paths, share the
switch statement entry, live-out store code, and the basic block.
llvm-svn: 12401
|
| |
|
|
|
|
|
| |
a member of the class. While we're at it, turn the collection into a set
instead of a vector to improve efficiency and make queries simpler.
llvm-svn: 12400
|
| |
|
|
|
|
| |
the command line, and the single loop extractor, usable by bugpoint
llvm-svn: 12390
|
| |
|
|
| |
llvm-svn: 12385
|
| |
|
|
|
|
| |
be non-empty! This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
llvm-svn: 12384
|
| |
|
|
| |
llvm-svn: 12382
|
| |
|
|
|
|
|
| |
Require 'simplified' loops, not just raw natural loops. This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll
llvm-svn: 12381
|
| |
|
|
|
|
|
|
| |
loop information won't see it, and we could have unreachable blocks pointing to
the non-header node of blocks in a natural loop. This isn't tidy, so have the
loopsimplify pass clean it up.
llvm-svn: 12380
|
| |
|
|
|
|
| |
curly braceage
llvm-svn: 12378
|
| |
|
|
|
|
|
| |
Make sure that the file interface header (IPO.h) is included first
remove dead #incldue
llvm-svn: 12375
|
| |
|
|
| |
llvm-svn: 12373
|
| |
|
|
| |
llvm-svn: 12372
|
| |
|
|
| |
llvm-svn: 12368
|
| |
|
|
|
|
|
| |
Fix InstCombine/2004-03-13-InstCombineInfLoop.ll which caused an infinite
loop compiling (I think) povray.
llvm-svn: 12365
|
| |
|
|
|
|
|
|
|
|
| |
* Be a lot more accurate about what the effects will be when inlining a call
to a function when an argument is an alloca.
* Dramatically reduce the penalty for inlining a call in a large function.
This heuristic made it almost impossible to inline a function into a large
function, no matter how small the callee is.
llvm-svn: 12363
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On the testcase from GCC PR12440, which has a LOT of loops (1392 of which require
preheaders to be inserted), this speeds up the loopsimplify pass from 1.931s to
0.1875s. The loop in question goes from 1.65s -> 0.0097s, which isn't bad. All of
these times are a debug build.
This adds a dependency on DominatorTree analysis that was not there before, but
we always had dominatortree available anyway, because LICM requires both loop
simplify and DT, so this doesn't add any extra analysis in practice.
llvm-svn: 12362
|
| |
|
|
| |
llvm-svn: 12355
|
| |
|
|
| |
llvm-svn: 12353
|
| |
|
|
| |
llvm-svn: 12319
|
| |
|
|
| |
llvm-svn: 12318
|
| |
|
|
| |
llvm-svn: 12317
|
| |
|
|
| |
llvm-svn: 12225
|
| |
|
|
| |
llvm-svn: 12224
|
| |
|
|
| |
llvm-svn: 12221
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows pointers to aggregate objects, whose elements are only read, to
be promoted and passed in by element instead of by reference. This can
enable a LOT of subsequent optimizations in the caller function.
It's worth pointing out that this stuff happens a LOT of C++ programs, because
objects in templates are generally passed around by reference. When these
templates are instantiated on small aggregate or scalar types, however, it is
more efficient to pass them in by value than by reference.
This transformation triggers most on C++ codes (e.g. 334 times on eon), but
does happen on C codes as well. For example, on mesa it triggers 72 times,
and on gcc it triggers 35 times. this is amazingly good considering that
we are using 'basicaa' so far.
llvm-svn: 12202
|
| |
|
|
| |
llvm-svn: 12200
|
| |
|
|
| |
llvm-svn: 12198
|
| |
|
|
|
|
| |
a zero value is the most likely way to cause further simplification, so we do it.
llvm-svn: 12197
|
| |
|
|
| |
llvm-svn: 12195
|
| |
|
|
|
|
| |
variables.
llvm-svn: 12193
|
| |
|
|
|
|
| |
arity now.
llvm-svn: 12086
|
| |
|
|
| |
llvm-svn: 12070
|
| |
|
|
| |
llvm-svn: 12068
|
| |
|
|
|
|
| |
* Add comments to ExtractLoop()
llvm-svn: 12053
|
| |
|
|
| |
llvm-svn: 12021
|
| |
|
|
|
|
| |
* Removing extraneous empty space and empty comment lines
llvm-svn: 12014
|
| |
|
|
|
|
| |
... which tickled the lowerinvoke pass because it used the BCE routines.
llvm-svn: 12012
|
| |
|
|
|
|
|
| |
Note that this is a band-aid put over a band-aid. This just undisables
tail duplication in on very specific case that it seems to work in.
llvm-svn: 11989
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and br->br code and generalizing it. This allows us to compile code like this:
int test(Instruction *I) {
if (isa<CastInst>(I))
return foo(7);
else if (isa<BranchInst>(I))
return foo(123);
else if (isa<UnwindInst>(I))
return foo(1241);
else if (isa<SetCondInst>(I))
return foo(1);
else if (isa<VAArgInst>(I))
return foo(42);
return foo(-1);
}
into:
int %_Z4testPN4llvm11InstructionE("struct.llvm::Instruction"* %I) {
entry:
%tmp.1.i.i.i.i.i.i.i = getelementptr "struct.llvm::Instruction"* %I, long 0, ubyte 4 ; <uint*> [#uses=1]
%tmp.2.i.i.i.i.i.i.i = load uint* %tmp.1.i.i.i.i.i.i.i ; <uint> [#uses=2]
%tmp.2.i.i.i.i.i.i = seteq uint %tmp.2.i.i.i.i.i.i.i, 27 ; <bool> [#uses=0]
switch uint %tmp.2.i.i.i.i.i.i.i, label %endif.0 [
uint 27, label %then.0
uint 2, label %then.1
uint 5, label %then.2
uint 14, label %then.3
uint 15, label %then.3
uint 16, label %then.3
uint 17, label %then.3
uint 18, label %then.3
uint 19, label %then.3
uint 32, label %then.4
]
...
As well as handling the cases in 176.gcc and many other programs more effectively.
llvm-svn: 11964
|
| |
|
|
|
|
| |
Do not just inject a new prototype.
llvm-svn: 11951
|
| |
|
|
|
|
|
| |
Create a new AddUsesToWorkList method
optimize memmove/set/cpy of zero bytes to a noop.
llvm-svn: 11941
|
| |
|
|
| |
llvm-svn: 11940
|
| |
|
|
| |
llvm-svn: 11939
|
| |
|
|
|
|
|
| |
function, as long as the loop isn't the only one in that function. This should
help debugging passes easier with BugPoint.
llvm-svn: 11936
|
| |
|
|
|
|
| |
a new function, taking care of inputs and outputs.
llvm-svn: 11935
|
| |
|
|
| |
llvm-svn: 11919
|
| |
|
|
|
|
|
| |
This is a really minor thing, but might help out the 'switch statement induction'
code in simplifycfg.
llvm-svn: 11900
|
| |
|
|
|
|
|
| |
multiple type names for the same structural type. Make DTE eliminate all
but one of the type names
llvm-svn: 11879
|