llvm-6502/test/CodeGen/Generic
Duncan Sands b0f1e1780c Add a new codegen pass that normalizes dwarf exception handling
code in preparation for code generation.  The main thing it does
is handle the case when eh.exception calls (and, in a future
patch, eh.selector calls) are far away from landing pads.  Right
now in practice you only find eh.exception calls close to landing
pads: either in a landing pad (the common case) or in a landing
pad successor, due to loop passes shifting them about.  However
future exception handling improvements will result in calls far
from landing pads:
(1) Inlining of rewinds.  Consider the following case:
In function @f:
...
  invoke @g to label %normal unwind label %unwinds
...
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

In function @g:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  "rethrow exception"

Now inline @g into @f.  Currently this is turned into:
In function @f:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  invoke "rethrow exception" to label %normal unwind label %unwinds
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

However we would like to simplify invoke of "rethrow exception" into
a branch to the %unwinds label.  Then %unwinds is no longer a landing
pad, and the eh.exception call there is then far away from any landing
pads.

(2) Using the unwind instruction for cleanups.
It would be nice to have codegen handle the following case:
  invoke @something to label %continue unwind label %run_cleanups
...
handler:
... perform cleanups ...
  unwind

This requires turning "unwind" into a library call, which
necessarily takes a pointer to the exception as an argument
(this patch also does this unwind lowering).  But that means
you are using eh.exception again far from a landing pad.

(3) Bugpoint simplifications.  When bugpoint is simplifying
exception handling code it often generates eh.exception calls
far from a landing pad, which then causes codegen to assert.
Bugpoint then latches on to this assertion and loses sight
of the original problem.

Note that it is currently rare for this pass to actually do
anything.  And in fact it normally shouldn't do anything at
all given the code coming out of llvm-gcc!  But it does fire
a few times in the testsuite.  As far as I can see this is
almost always due to the LoopStrengthReduce codegen pass
introducing pointless loop preheader blocks which are landing
pads and only contain a branch to another block.  This other
block contains an eh.exception call.  So probably by tweaking
LoopStrengthReduce a bit this can be avoided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 20:36:31 +00:00
..
GC
2002-04-14-UnexpectedUnsignedType.ll
2002-04-16-StackFrameSizeAlignment.ll
2003-05-27-phifcmpd.ll
2003-05-27-useboolinotherbb.ll
2003-05-27-usefsubasbool.ll
2003-05-28-ManyArgs.ll
2003-05-30-BadFoldGEP.ll
2003-05-30-BadPreselectPhi.ll
2003-07-06-BadIntCmp.ll
2003-07-07-BadLongConst.ll
2003-07-08-BadCastToBool.ll
2003-07-29-BadConstSbyte.ll
2004-02-08-UnwindSupport.ll
2004-05-09-LiveVarPartialRegister.ll
2005-01-18-SetUO-InfLoop.ll
2005-04-09-GlobalInPHI.ll
2005-07-12-memcpy-i64-length.ll
2005-10-18-ZeroSizeStackObject.ll
2005-10-21-longlonggtu.ll
2005-12-01-Crash.ll
2005-12-12-ExpandSextInreg.ll
2006-01-12-BadSetCCFold.ll
2006-01-18-InvalidBranchOpcodeAssert.ll
2006-02-12-InsertLibcall.ll
2006-03-01-dagcombineinfloop.ll
2006-04-11-vecload.ll
2006-04-26-SetCCAnd.ll
2006-04-28-Sign-extend-bool.ll
2006-05-06-GEP-Cast-Sink-Crash.ll
2006-06-12-LowerSwitchCrash.ll Second attempt: 2009-04-29 00:15:41 +00:00
2006-06-13-ComputeMaskedBitsCrash.ll Second attempt: 2009-04-29 00:15:41 +00:00
2006-06-28-SimplifySetCCCrash.ll
2006-07-03-schedulers.ll
2006-08-30-CoalescerCrash.ll
2006-09-02-LocalAllocCrash.ll
2006-09-06-SwitchLowering.ll
2006-10-27-CondFolding.ll
2006-10-29-Crash.ll
2006-11-06-MemIntrinsicExpand.ll
2006-11-20-DAGCombineCrash.ll
2006-12-16-InlineAsmCrash.ll
2007-01-15-LoadSelectCycle.ll
2007-02-16-BranchFold.ll
2007-02-23-DAGCombine-Miscompile.ll
2007-02-25-invoke.ll
2007-04-08-MultipleFrameIndices.ll
2007-04-13-SwitchLowerBadPhi.ll Second attempt: 2009-04-29 00:15:41 +00:00
2007-04-14-BitTestsBadMask.ll
2007-04-17-lsr-crash.ll
2007-04-27-BitTestsBadMask.ll
2007-04-27-InlineAsm-X-Dest.ll
2007-04-27-LargeMemObject.ll
2007-04-30-LandingPadBranchFolding.ll
2007-05-03-EHTypeInfo.ll
2007-05-05-Personality.ll
2007-05-15-InfiniteRecursion.ll
2007-06-06-CriticalEdgeLandingPad.ll Add a new codegen pass that normalizes dwarf exception handling 2009-05-22 20:36:31 +00:00
2007-11-21-UndeadIllegalNode.ll
2007-12-17-InvokeAsm.ll
2007-12-31-UnusedSelector.ll
2008-01-25-dag-combine-mul.ll
2008-01-30-LoadCrash.ll
2008-02-04-Ctlz.ll
2008-02-04-ExtractSubvector.ll
2008-02-20-MatchingMem.ll
2008-02-25-NegateZero.ll
2008-02-26-NegatableCrash.ll
2008-08-07-PtrToInt-SmallerInt.ll
2009-03-17-LSR-APInt.ll LSR shouldn't ever try to hack on integer IV's larger than 64-bits. Right now 2009-03-17 23:58:30 +00:00
2009-03-29-SoftFloatVectorExtract.ll Fix PR3899: add support for extracting floats from vectors 2009-03-29 13:51:06 +00:00
2009-04-10-SinkCrash.ll fix two problems with machine sinking: 2009-04-10 16:38:36 +00:00
2009-04-28-i128-cmp-crash.ll Disable the load-shrinking optimization from looking at 2009-04-29 03:45:07 +00:00
add-with-overflow-24.ll
add-with-overflow.ll
addc-fold2.ll
APIntLoadStore.ll Help DejaGnu avoid pipe-jam by producing less output from certain test cases. 2009-05-16 00:34:42 +00:00
APIntParam.ll Help DejaGnu avoid pipe-jam by producing less output from certain test cases. 2009-05-16 00:34:42 +00:00
APIntSextParam.ll Help DejaGnu avoid pipe-jam by producing less output from certain test cases. 2009-05-16 00:34:42 +00:00
APIntZextParam.ll Help DejaGnu avoid pipe-jam by producing less output from certain test cases. 2009-05-16 00:34:42 +00:00
asm-large-immediate.ll
badarg6.ll
badCallArgLRLLVM.ll
badFoldGEP.ll
badlive.ll
BasicInstrs.ll
bit-intrinsics.ll
bool-to-double.ll
bool-vector.ll
BurgBadRegAlloc.ll
call2-ret0.ll
call-ret0.ll
call-ret42.ll
call-void.ll
cast-fp.ll
ConstantExprLowering.ll
constindices.ll
debug-info.ll
dg.exp
div-neg-power-2.ll
empty-load-store.ll
externally_available.ll Add a new "available_externally" linkage type. This is intended 2009-04-13 05:44:34 +00:00
fastcall.ll
fneg-fabs.ll
fp_to_int.ll
fp-to-int-invalid.ll Fix PR 4057, a crash doing float->char const folding. 2009-04-24 21:34:13 +00:00
fpowi-promote.ll
fwdtwice.ll
getresult-undef.ll
global-ret0.ll
hello.ll
i128-addsub.ll
i128-arith.ll
inline-asm-special-strings.ll wire up support for emitting "special" values from inline asm 2009-03-10 05:37:13 +00:00
intrinsics.ll
invalid-memcpy.ll
isunord.ll
llvm-ct-intrinsics.ll
Makefile
multiple-return-values-cross-block-with-invoke.ll
negintconst.ll
nested-select.ll
phi-immediate-factoring.ll
pr2625.ll
pr3288.ll
print-add.ll
print-arith-fp.ll
print-arith-int.ll
print-int.ll
print-mul-exp.ll
print-mul.ll
print-shift.ll
ret0.ll
ret42.ll
select-cc.ll
select.ll
shift-int64.ll
spillccr.ll
stack-protector.ll
stacksave-restore.ll
storetrunc-fp.ll
switch-crit-edge-constant.ll
switch-lower-feature-2.ll
switch-lower-feature.ll
switch-lower.ll
SwitchLowering.ll
trap.ll
v-split.ll
vector-casts.ll Revert accidental testcase reduction 2009-04-27 18:42:40 +00:00
vector-constantexpr.ll
vector-identity-shuffle.ll
vector.ll