Final remove of exception handling from this file. lib/System can no longer
throw exceptions so there's no need for try/catch blocks here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29848 91177308-0d34-0410-b5e6-96231b3b80d8
portion fo the program name via sys::Path().getLast(). This makes error
messages more readable since this is invariably used only in error
messages. Instead of:
/path/to/llvm/bin/directory/toolname: error message
we will now get:
toolname: error message
Also, since we always have a program name (even if its defaulted), don't
check to see if it is set or not when generating error messages. This
eliminates a bunch of constant strings, saving a little under 1K of data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29842 91177308-0d34-0410-b5e6-96231b3b80d8
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust the use of MappedFile to its new non-throwing interface. We just
propagate the exceptions if an error occurs. This will get cleaned up
later, incrementally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29820 91177308-0d34-0410-b5e6-96231b3b80d8
Make the Bytecode Reader use setjmp/longjump instead of exceptions to handle
errors. The alternative was even uglier than setjmp/longjump as it would
impact the interface and workings of nearly every function in the reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29819 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust users of MappedFile to its new non-throwing interface. Note that in
most cases the lazy step of just throwing after a call to MappedFile was
installed. This was done in the name of incremental changes. Getting rid of
the new throw statements will take adjustment of interfaces and propagation
of errors to higher levels. Those changes will come in subsequent patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29817 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a bug in my last patch that botched file redirection by using explicit
scoping of if statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29815 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29791 91177308-0d34-0410-b5e6-96231b3b80d8
Remove all exception code from Program.inc and implement its new interface
with an ErrMsg string argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29790 91177308-0d34-0410-b5e6-96231b3b80d8
Make sys::Program::ExecuteAndWait not throw exceptions and update any
affected code. It now return -9999 to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29785 91177308-0d34-0410-b5e6-96231b3b80d8
1. Actually turn on -fno-exceptions in libraries that do not have the
REQUIRES_EH option in their Makefile. The following library file size
savings were made (DEBUG):
libLLVMDataStructure.a 525K
libLLVMCore.a 380K
libLLVMCodeGen.a 350K
libLLVMTransformUtils.a 305K
libLLVMScalarOpts.a 270K
libLLVMAnalysis.a 247K
libLLVMSelectionDAG.a 233K
libLLVMipo.a 175K
LLVMX86.o 123K
LLVMPPC.o 81K
libLLVMipa.a 17K
TOTAL 2,706K
Note that the savings is actually a little larger than this because
I didn't count any of the libraries that had small changes.
2. Remove REQUIRES_EH from the AsmParser library as it is now exception
free. This resulted in a nearly 78K drop in the size of the debug
library for AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29767 91177308-0d34-0410-b5e6-96231b3b80d8
Rid the Assembly Parser of exceptions. This is a really gross hack but it
will do until the Assembly Parser is re-written as a recursive descent.
The basic premise is that wherever the old "ThrowException" function was
called (new name: GenerateError) we set a flag (TriggerError). Every
production checks that flag and calls YYERROR if it is set. Additionally,
each call to ThrowException in the grammar is replaced with GEN_ERROR
which calls GenerateError and then YYERROR immediately. This prevents
the remaining production from continuing after an error condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29763 91177308-0d34-0410-b5e6-96231b3b80d8
This reduces selectiondag time on kc++ from 5.43s to 4.98s (9%). More
significantly, this speeds up the default ppc scheduler from ~1571ms to 1063ms,
a 33% speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29743 91177308-0d34-0410-b5e6-96231b3b80d8
of value-type nodes. This avoids having to do mallocs for std::vectors of
valuetypes when a node returns more than one type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29685 91177308-0d34-0410-b5e6-96231b3b80d8
Not only will this take huge amounts of compile time, the resultant loop nests
won't be useful for optimization. This reduces loopsimplify time on
Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll from ~32s to ~0.4s
with a debug build of llvm on a 2.7Ghz G5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29647 91177308-0d34-0410-b5e6-96231b3b80d8
pounding on Loop::contains (which is O(n) in the size of the loop), use a
sorted vector, which is O(log(N)) for each query. This speeds up Duraid's
horrible testcase from ~72s to ~31s in a debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29645 91177308-0d34-0410-b5e6-96231b3b80d8
blocks that target loop blocks.
Before, the code was run once per loop, and depended on the number of
predecessors each block in the loop had. Unfortunately, scanning preds can
be really slow when huge numbers of phis exist or when phis with huge numbers
of inputs exist.
Now, the code is run once per function and scans successors instead of preds,
which is far faster. In addition, the new code is simpler and is goto free,
woo.
This change speeds up a nasty testcase Duraid provided me from taking hours to
taking ~72s with a debug build. The functionality this implements is already
tested in the testsuite as Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29644 91177308-0d34-0410-b5e6-96231b3b80d8
in the start of an array and a count of operands where applicable. In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap. In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.
I updated a lot of code calling getNode that takes a vector, but ran out of
time. The rest of the code should be updated, and these methods should be
removed.
We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.
It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29566 91177308-0d34-0410-b5e6-96231b3b80d8
method that took std::vector<SDOperand> to take a pointer to a first operand
and #operands.
This speeds up isel on kc++ by about 3%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29561 91177308-0d34-0410-b5e6-96231b3b80d8
selection is done. That's rather expensive especially in situations where it
isn't really needed.
Move back to a searching the predecessors, but make use of topological order
to trim the search space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29559 91177308-0d34-0410-b5e6-96231b3b80d8
to build a loadable module is now correctly defined and documented so this
workaround isn't needed any longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29553 91177308-0d34-0410-b5e6-96231b3b80d8
SlowOperatingInfo, Statistics). Besides providing an example of how to
use these facilities, it also serves to debug problems with runtime linking
when dlopening a loadable module. These three support facilities exercise
different combinations of Text/Weak Weak/Text and Text/Text linking
between the executable and the module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29552 91177308-0d34-0410-b5e6-96231b3b80d8
1. Change the usage of LOADABLE_MODULE so that it implies all the things
necessary to make a loadable module. This reduces the user's burdern to
get a loadable module correctly built.
2. Document the usage of LOADABLE_MODULE in the MakefileGuide
3. Adjust the makefile for lib/Transforms/Hello to use the new specification
for building loadable modules
4. Adjust the sample project to not attempt to build a shared library for
its little library. This was just wasteful and not instructive at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29551 91177308-0d34-0410-b5e6-96231b3b80d8
eliminates a bunch of std::map's in the SelectionDAG, replacing them with a
home-grown hashtable.
This is still a work in progress: not all the maps have been moved over and the
hashtable never resizes. That said, this still speeds up llc 20% on kimwitu++
with -fast -regalloc=local using a release build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29550 91177308-0d34-0410-b5e6-96231b3b80d8
the removal of directories. Using std::remove is indiscriminate and can
lead to the removal of things like /dev/null if run as root. The
Path::eraseFromDisk method ensures that we only ever remove regular files
or directories, but never character or block special nodes. This should
clear up the problem with usage like: llvm-as -o /dev/null which is used
in the llvm-test makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29540 91177308-0d34-0410-b5e6-96231b3b80d8
Update ltld.[ch] to version 1.5.22.
Correct the notes about updating these tools (autoconf/README.TXT)
Add configure options for getting the correct option for including a whole
archive when linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29529 91177308-0d34-0410-b5e6-96231b3b80d8
1. Update an obsolete comment.
2. Make the sorting by base an explicit (though still N^2) step, so
that the code is more clear on what it is doing.
3. Partition uses so that uses inside the loop are handled before uses
outside the loop.
Note that none of these changes currently changes the code inserted by LSR,
but they are a stepping stone to getting there.
This code is the result of some crazy pair programming with Nate. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29493 91177308-0d34-0410-b5e6-96231b3b80d8
Looks like libstdc++ implementation does not scale very well. Switch back
to using directly managed arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29469 91177308-0d34-0410-b5e6-96231b3b80d8
down approach, inspired by discussions with Tanya.
This approach is significantly faster, because it does not need dominator
frontiers and it does not insert extraneous unused PHI nodes. For example, on
252.eon, in a release-asserts build, this speeds up LCSSA (which is the slowest
pass in gccas) from 9.14s to 0.74s on my G5. This code is also slightly smaller
and significantly simpler than the old code.
Amusingly, in a normal Release build (which includes the
"assert(L->isLCSSAForm());" assertion), asserting that the result of LCSSA
is in LCSSA form is actually slower than the LCSSA transformation pass
itself on 252.eon. I will see if Loop::isLCSSAForm can be sped up next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29463 91177308-0d34-0410-b5e6-96231b3b80d8
move the constant pool to .text
correctly print loads of labels
mark R0, R1, R2 and R3 as caller save
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29451 91177308-0d34-0410-b5e6-96231b3b80d8
2. Added argument to instruction scheduler creators so the creators can do
special things.
3. Repaired target hazard code.
4. Misc.
More to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29450 91177308-0d34-0410-b5e6-96231b3b80d8