llvm-6502/lib
Duncan Sands 57810cdac4 Fix PR1628. When exception handling is turned on,
labels are generated bracketing each call (not just
invokes).  This is used to generate entries in
the exception table required by the C++ personality.
However it gets in the way of tail-merging.  This
patch solves the problem by no longer placing labels
around ordinary calls.  Instead we generate entries
in the exception table that cover every instruction
in the function that wasn't covered by an invoke
range (the range given by the labels around the invoke).
As an optimization, such entries are only generated for
parts of the function that contain a call, since for
the moment those are the only instructions that can
throw an exception [1].  As a happy consequence, we
now get a smaller exception table, since the same
region can cover many calls.  While there, I also
implemented folding of invoke ranges - successive
ranges are merged when safe to do so.  Finally, if
a selector contains only a cleanup, there's a special
shorthand for it - place a 0 in the call-site entry.
I implemented this while there.  As a result, the
exception table output (excluding filters) is now
optimal - it cannot be made smaller [2].  The
problem with throw filters is that folding them
optimally is hard, and the benefit of folding them is
minimal.

[1] I tested that having trapping instructions (eg
divide by zero) in such a region doesn't cause trouble.
[2] It could be made smaller with the help of higher
layers, eg by having branch folding reorder basic blocks
ending in invokes with the same landing pad so they
follow each other.  I don't know if this is worth doing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05 11:27:52 +00:00
..
Analysis Use SmallVector. 2007-08-21 16:54:51 +00:00
Archive finishing touches of bytecode -> bitcode changes. also unbreak Windows 2007-07-06 20:28:40 +00:00
AsmParser Update generated files. 2007-09-04 18:46:50 +00:00
Bitcode Update GEP constructors to use an iterator interface to fix 2007-09-04 15:46:09 +00:00
CodeGen Fix PR1628. When exception handling is turned on, 2007-09-05 11:27:52 +00:00
Debugger switch this to bitcode instead of bytecode 2007-05-06 09:29:13 +00:00
ExecutionEngine rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned() 2007-08-23 05:15:32 +00:00
Linker Fix PR1611 - Visibility should be ignored for a declaration 2007-08-19 22:22:54 +00:00
Support Oops, should be part of 41664; won't work very well without this piece. 2007-08-31 23:35:31 +00:00
System Fix PR1581, patch by Timo Savola 2007-07-31 06:00:51 +00:00
Target Add the 64-bit versions of the DS* Altivec instructions. 2007-09-05 04:05:20 +00:00
Transforms Insert cloned loop basic blocks before original loop header. 2007-09-04 20:46:35 +00:00
VMCore Update GEP constructors to use an iterator interface to fix 2007-09-04 15:46:09 +00:00
Makefile build lib/Archive instead of lib/Bytecode 2007-05-06 19:50:06 +00:00