llvm-project/llvm/lib/Transforms/Scalar
David Majnemer 8a1c45d6e8 [IR] Reformulate LLVM's EH funclet IR
While we have successfully implemented a funclet-oriented EH scheme on
top of LLVM IR, our scheme has some notable deficiencies:
- catchendpad and cleanupendpad are necessary in the current design
  but they are difficult to explain to others, even to seasoned LLVM
  experts.
- catchendpad and cleanupendpad are optimization barriers.  They cannot
  be split and force all potentially throwing call-sites to be invokes.
  This has a noticable effect on the quality of our code generation.
- catchpad, while similar in some aspects to invoke, is fairly awkward.
  It is unsplittable, starts a funclet, and has control flow to other
  funclets.
- The nesting relationship between funclets is currently a property of
  control flow edges.  Because of this, we are forced to carefully
  analyze the flow graph to see if there might potentially exist illegal
  nesting among funclets.  While we have logic to clone funclets when
  they are illegally nested, it would be nicer if we had a
  representation which forbade them upfront.

Let's clean this up a bit by doing the following:
- Instead, make catchpad more like cleanuppad and landingpad: no control
  flow, just a bunch of simple operands;  catchpad would be splittable.
- Introduce catchswitch, a control flow instruction designed to model
  the constraints of funclet oriented EH.
- Make funclet scoping explicit by having funclet instructions consume
  the token produced by the funclet which contains them.
- Remove catchendpad and cleanupendpad.  Their presence can be inferred
  implicitly using coloring information.

N.B.  The state numbering code for the CLR has been updated but the
veracity of it's output cannot be spoken for.  An expert should take a
look to make sure the results are reasonable.

Reviewers: rnk, JosephTremoulet, andrew.w.kaylor

Differential Revision: http://reviews.llvm.org/D15139

llvm-svn: 255422
2015-12-12 05:38:55 +00:00
..
ADCE.cpp [PM] Port ADCE to the new pass manager 2015-10-30 23:13:18 +00:00
AlignmentFromAssumptions.cpp AlignmentFromAssumptions and SLPVectorizer preserves AA and GlobalsAA 2015-12-11 17:46:01 +00:00
BDCE.cpp Add GlobalsAA as preserved to a bunch of transforms 2015-09-10 10:22:12 +00:00
CMakeLists.txt LLE 6/6: Add LoopLoadElimination pass 2015-11-03 23:50:08 +00:00
ConstantHoisting.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
ConstantProp.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
CorrelatedValuePropagation.cpp [AttributeSet] Overload AttributeSet::addAttribute to reduce compile 2015-12-02 06:58:49 +00:00
DCE.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
DeadStoreElimination.cpp Revert r255247, r255265, and r255286 due to serious compile-time regressions. 2015-12-11 18:39:41 +00:00
EarlyCSE.cpp EarlyCSE: fix typo from rL255054. 2015-12-09 09:05:42 +00:00
FlattenCFGPass.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
Float2Int.cpp [Float2Int] Don't operate on vector instructions 2015-12-09 21:08:18 +00:00
GVN.cpp Use range-based for loops. NFC 2015-11-28 08:23:04 +00:00
IndVarSimplify.cpp [IndVars] Use any_of and foreach instead of explicit for loops; NFC 2015-12-08 23:52:58 +00:00
InductiveRangeCheckElimination.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
JumpThreading.cpp [ValueTracking] Add parameters to isImpliedCondition; NFC 2015-11-06 19:01:08 +00:00
LICM.cpp Revert "Revert "Strip metadata when speculatively hoisting instructions (r252604)" 2015-11-18 14:50:18 +00:00
LLVMBuild.txt Update libdeps in LLVMipo and LLVMScalarOpts, corresponding to r245940. 2015-08-25 17:11:17 +00:00
LoadCombine.cpp [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
LoopDeletion.cpp Add GlobalsAA as preserved to a bunch of transforms 2015-09-10 10:22:12 +00:00
LoopDistribute.cpp Re-commit r255115, with the PredicatedScalarEvolution class moved to 2015-12-09 16:06:28 +00:00
LoopIdiomRecognize.cpp [LIR] Push check into helper function. NFC. 2015-12-01 14:26:35 +00:00
LoopInstSimplify.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LoopInterchange.cpp Test commit access - Fix few missing '.' in comments of LoopInterchange code. 2015-12-09 05:16:24 +00:00
LoopLoadElimination.cpp [LLE] Use the PredicatedScalarEvolution interface to query SCEVs for dependences 2015-12-10 11:07:18 +00:00
LoopRerollPass.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
LoopRotation.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LoopStrengthReduce.cpp [LoopStrengthReduce] Mark dump() definitions as LLVM_DUMP_METHOD. 2015-11-23 02:47:30 +00:00
LoopUnrollPass.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
LoopUnswitch.cpp LoopPass: Simplify the API for adding a new loop. NFC 2015-10-22 21:21:32 +00:00
LowerAtomic.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LowerExpectIntrinsic.cpp fix typo; NFC 2015-08-24 20:11:14 +00:00
Makefile
MemCpyOptimizer.cpp Use modulo operator instead of multiplying result of a divide and subtracting from the original dividend. NFC. 2015-11-21 17:44:42 +00:00
MergedLoadStoreMotion.cpp Fix some Clang-tidy modernize warnings, other minor fixes. 2015-11-04 22:32:32 +00:00
NaryReassociate.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
PartiallyInlineLibCalls.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
PlaceSafepoints.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
Reassociate.cpp [IR] Reformulate LLVM's EH funclet IR 2015-12-12 05:38:55 +00:00
Reg2Mem.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
RewriteStatepointsForGC.cpp Remove an intermediate lambda. NFC 2015-11-29 05:38:08 +00:00
SCCP.cpp [IR] Reformulate LLVM's EH funclet IR 2015-12-12 05:38:55 +00:00
SROA.cpp Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
Scalar.cpp LLE 6/6: Add LoopLoadElimination pass 2015-11-03 23:50:08 +00:00
ScalarReplAggregates.cpp Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
Scalarizer.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
SeparateConstOffsetFromGEP.cpp Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC. 2015-11-18 07:07:59 +00:00
SimplifyCFGPass.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
Sink.cpp [IR] Reformulate LLVM's EH funclet IR 2015-12-12 05:38:55 +00:00
SpeculativeExecution.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
StraightLineStrengthReduce.cpp [SCEV] Introduce ScalarEvolution::getOne and getZero. 2015-09-23 01:59:04 +00:00
StructurizeCFG.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
TailRecursionElimination.cpp Add 'notail' marker for call instructions. 2015-11-06 23:55:38 +00:00