of callees between executions.
On eon, in release mode, this changes the inliner from taking 11.5712s
to taking 2.2066s. In debug mode, it went from taking 14.4148s to
taking 7.0745s. In release mode, this is a 24.7% speedup of gccas, in
debug mode, it's a total speedup of 11.7%.
This also makes it slightly more aggressive. This could be because we
are not judging the size of the functions quite as accurately as before.
When we start looking at the performance of the generated code, this can
be investigated further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8890 91177308-0d34-0410-b5e6-96231b3b80d8
"minimal" SSA form (in other words, it doesn't insert dead PHIs). This
speeds up the mem2reg pass very significantly because it doesn't have to
do a lot of frivolous work in many common cases.
In the 252.eon function I have been playing with, this doesn't even insert
the 120 PHI nodes that it used to which were trivially dead (in the process
of promoting 356 alloca instructions overall). This speeds up the mem2reg
pass from 1.2459s to 0.1284s. More significantly, the DCE pass used to take
2.4138s to remove the 120 dead PHI nodes that mem2reg constructed, now it
takes 0.0134s (which is the time to scan the function and decide that there
is nothing dead). So overall, on this one function, we speed things up a
total of 3.5179s, which is a 24.8x speedup! :)
This change is tested by the Mem2Reg/2003-10-05-DeadPHIInsertion.ll test,
which now passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8884 91177308-0d34-0410-b5e6-96231b3b80d8
basic block. This is amazingly common in code generated by the C/C++ front-ends.
This change makes it not have to insert ANY phi nodes, whereas before it would insert
a ton of dead ones which DCE would have to clean up.
Thus, this fix improves compile-time performance of these trivial allocas in two ways:
1. It doesn't have to do the walking and book-keeping for renaming
2. It does not insert dead phi nodes for them which would have to
subsequently be cleaned up.
On my favorite testcase from 252.eon, this special case handles 305 out of
356 promoted allocas in the function. It speeds up the mem2reg pass from 7.5256s
to 1.2505s. It inserts 677 fewer dead PHI nodes, which speeds up a subsequent
-dce pass from 18.7524s to 2.4806s.
There are still 120 trivially dead PHI nodes being inserted for variables used
in multiple basic blocks, but they are not handled by this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8881 91177308-0d34-0410-b5e6-96231b3b80d8
This reduces the time to verify a function from eon with a large number of
large PHI nodes from 22996s (6.38 hours) to 10.5499s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8866 91177308-0d34-0410-b5e6-96231b3b80d8
*** Revamp the code which handled unreachable code in the function. Now the
code is much more efficient for high-degree basic blocks, such as those
that occur in the 252.eon SPEC benchmark.
For the interested, the time to promote a SINGLE alloca in _ZN7mrScene4ReadERSi
function used to be > 3.5s. Now it is < .075s. The function has a LOT of
allocas in it, so it appeared to be infinite looping, this should make it much
nicer. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8863 91177308-0d34-0410-b5e6-96231b3b80d8
work-list of value definitions. This allows elimination of the explicit
'iterative' step of the algorithm, and also reuses temporary memory better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8861 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not insert a new entry into NewPhiNodes during the rename pass if there are no PHIs in a block.
* Do not compute WriteSets in parallel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8858 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the KillList instance variable, instead, just delete loads and
stores as they are "renamed", and delete allocas when they are done
* Make the 'visited' set an instance variable to avoid passing it on the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8857 91177308-0d34-0410-b5e6-96231b3b80d8
constants as necessary due to type resolution. With this change, the
following spec benchmarks now link: 176.gcc, 177.mesa, 252.eon,
253.perlbmk, & 300.twolf. IOW, all SPEC INT and FP benchmarks now link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8853 91177308-0d34-0410-b5e6-96231b3b80d8
machinery. This dramatically simplifies how things works, removes irritating
little corner cases, and overall improves speed and reliability.
Highlights of this change are:
1. The exponential algorithm built into the code is now gone. For example
the time to disassemble one bytecode file from the mesa benchmark went
from taking 12.5s to taking 0.16s.
2. The linker bugs should be dramatically reduced. The one remaining bug
has to do with constant handling, which I actually introduced in
"union-find" checkins.
3. The code is much easier to follow, as a result of fewer special cases.
It's probably also smaller. yaay.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8842 91177308-0d34-0410-b5e6-96231b3b80d8
This makes use of the new PATypeHolder's to keep types from being deleted
prematurely, instead of the wierd "self reference" garbage. This is easier
to understand and more efficient as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8834 91177308-0d34-0410-b5e6-96231b3b80d8
significantly more complete. Instead, just make DerivedType's AbstractTypeUser's,
and make Value contain a PATypeHolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8828 91177308-0d34-0410-b5e6-96231b3b80d8
2. I think the caller of LinkFiles() should not ignore a true return value.
(If you have a good reason why it ought to, feel free to revert
this. It's just something that's been bugging me for a while.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8760 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed space between function name and its argument list
* Removed space between '&' and variable name
* Removed empty comment lines: `//'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8750 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill unused ALIN_PTRS #define
* Set the error string if user passed it in to be compatible with former API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8701 91177308-0d34-0410-b5e6-96231b3b80d8
Shorten the markSuggestedColorUsable method.
Add a switch for saving reg. alloc. state (coming soon).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8697 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of a #define, use inline function
* Fix the name on the #define, errr... now inline function to be more logical:
it doesn't CHECK the alignment, it PERFORMS the alignment
* To get string name of a Type*, use getDescription(), not getName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8683 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we align the buffer we're given
* Do not let exceptions propagate when the caller asks for a Module*
* Add doxygenified comments to wrapper functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8682 91177308-0d34-0410-b5e6-96231b3b80d8
because it can add a module ID which we do not have at this time.
* Check to see if the module has been initialized when materializing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8674 91177308-0d34-0410-b5e6-96231b3b80d8
- no more passing around a string pointer to set errors
- no more returning booleans and checking for errors, we use C++ exceptions
* Broke functionality into 2 new classes, one reads from file, one from a stream
* Implemented lazy function streaming - the parser can read in a function at-a-time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8671 91177308-0d34-0410-b5e6-96231b3b80d8
... 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8664 91177308-0d34-0410-b5e6-96231b3b80d8
(I also zapped printMachineCode() and printLabel() at the previous checkin,
but forgot to mention it.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8646 91177308-0d34-0410-b5e6-96231b3b80d8
PhyRegAlloc.cpp:
Don't include TargetMachine.h or TargetRegInfo.h, because these are provided
by PhyRegAlloc.h.
Merge class RegisterAllocator into class PhyRegAlloc.
Simplify & move ctor, dtor to PhyRegAlloc.h.
Make some of PhyRegAlloc's reference members into pointer members,
so they can be more easily messed with.
MarkAllocatedRegs() becomes a member method, with fewer args.
PhyRegAlloc.h:
Include Pass.h, TargetMachine.h and TargetRegInfo.h. Don't declare
TargetRegInfo forward.
Give AddedInstrns the obvious clear() method.
Make some of PhyRegAlloc's reference members into pointer members,
so they can be more easily messed with.
Add prototype for markAllocatedRegs().
Remove unused inline void constructLiveRanges().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8641 91177308-0d34-0410-b5e6-96231b3b80d8
Renamed functions that were all lower-case.
Moved functions from util.cpp into linker.cpp or gccld.cpp.
Removed util.h and created gccld.h.
Refactored the linker functionality in linker.cpp so that it is easier to
follow, easier to modify, and it's library/object file search behavior is
easier to understand and document.
Added code to include library paths when doing native linking, but this
causes problems and is currently #ifdef'd out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8609 91177308-0d34-0410-b5e6-96231b3b80d8
functionality of FunctionInfo pass as doFinalization method.
Rename pass to match names of other passes like it.
Rename the pass creator fn to mimic the other creator fn names.
Include StringExtras for utostr().
Make symbol prologue/epilogue stuff redundant with
EmitBytecodeToAssembly, in preparation for refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8597 91177308-0d34-0410-b5e6-96231b3b80d8
arguments and environment.
Perhaps it should be merged with the RunProgramWithTimeout function, but I'd
want to allow it to inherit the parent process's stdin and stdout.
I'll save that for a rainy day...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8577 91177308-0d34-0410-b5e6-96231b3b80d8
in it being both shorter and more effective. It no longer depends on the
callgraph, so one FIXME has been fixed.
Additionally, this pass was not able to delete recursive (but dead) functions
if they were pointed to by global variables which were also dead. In fact
this pass had a lot of problems deleting functions which were only pointed
to by dead globals and other stuff.
Fixing this means that the entire EH library should be stripped away now from
programs that don't use sjlj or exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8567 91177308-0d34-0410-b5e6-96231b3b80d8