In lookupFunction():
Change to use "F" for Function argument instead of ancient "M".
Remove commented-out code.
Change to use GetAddressOfSymbol instead of dlsym.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9013 91177308-0d34-0410-b5e6-96231b3b80d8
are ordered by name, not by slot, so the previous solution wasn't any good.
On a large testcase, this reduces time to parse from 2.17s to 1.58s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9002 91177308-0d34-0410-b5e6-96231b3b80d8
changes:
* BytecodeReader::getType(...) used to return a null pointer
on error. This was only checked about half the time. Now we convert
it to throw an exception, and delete the half that checked for error.
This was checked in before, but psmith crashed and lost the change :(
* insertValue no longer returns -1 on error, so callers don't need to
check for it.
* Substantial rewrite of InstructionReader.cpp, to use more efficient,
simpler, data structures. This provides another 5% speedup. This also
makes the code much easier to read and understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8984 91177308-0d34-0410-b5e6-96231b3b80d8
simplifies the control flow a bit. This provides a small (~3%) speedup,
but it's primarily a cleanup exercise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8983 91177308-0d34-0410-b5e6-96231b3b80d8
new, simpler, ForwardReferences data structure. This is just the first
simple replacement, subsequent changes will improve the code more.
This simple change improves the performance of loading a file from HDF5
(contributed by Bill) from 2.36s to 1.93s, a 22% improvement. This
presumably has to do with the fact that we only create ONE placeholder for
a particular forward referenced values, and also may be because the data
structure is much simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8979 91177308-0d34-0410-b5e6-96231b3b80d8
in the bytecode parser. Before we tried to shoehorn basic blocks into the
"getValue" code path with other types of values. For a variety of reasons
this was a bad idea, so this patch separates it out into its own data structure.
This simplifies the code, makes it fit in 80 columns, and is also much faster.
In a testcase provided by Bill, which has lots of PHI nodes, this patch speeds
up bytecode parsing from taking 6.9s to taking 2.32s. More speedups to
follow later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8977 91177308-0d34-0410-b5e6-96231b3b80d8
to avoid reprocessing PHI nodes needlessly. This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8964 91177308-0d34-0410-b5e6-96231b3b80d8
of a test that Bill Wendling sent me from 228.5s to 105s. Obviously there is
more improvement to be had, but this is a nice speedup which should be "felt"
by many programs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8962 91177308-0d34-0410-b5e6-96231b3b80d8
and TargetInstrDescriptor::ImplicitUses to always point to a null
terminated array and never be null. So there is no need to check for
pointer validity when iterating over those sets. Code that looked
like:
if (const unsigned* AS = TID.ImplicitDefs) {
for (int i = 0; AS[i]; ++i) {
// use AS[i]
}
}
was changed to:
for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) {
// use *AS
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
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