Revision tags: llvmorg-3.8.0-rc1 |
|
#
44b3f961 |
| 15-Jan-2016 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Rename CatchReturnInst::getParentPad, NFC
Summary: Rename to getCatchSwitchParentPad, to make it more clear which ancestor the "parent" in question is. Add a comment pointing out the key fe
[WinEH] Rename CatchReturnInst::getParentPad, NFC
Summary: Rename to getCatchSwitchParentPad, to make it more clear which ancestor the "parent" in question is. Add a comment pointing out the key feature that the returned pad indicates which funclet contains the successor block.
Reviewers: rnk, andrew.w.kaylor, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16222
llvm-svn: 257933
show more ...
|
#
086fec23 |
| 08-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Update WinEHFuncInfo if StackColoring merges allocas
Windows EH keeping track of which frame index corresponds to a catchpad in order to inform the runtime where the catch parameter should b
[WinEH] Update WinEHFuncInfo if StackColoring merges allocas
Windows EH keeping track of which frame index corresponds to a catchpad in order to inform the runtime where the catch parameter should be initialized. LLVM's optimizations are able to prove that the memory used by the catch parameter can be reused with another memory optimization, changing it's frame index.
We need to keep WinEHFuncInfo up to date with respect to this or we will miscompile/assert.
This fixes PR26069.
llvm-svn: 257158
show more ...
|
#
eea7582b |
| 06-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Remove calculateCatchReturnSuccessorColors
The functionality that calculateCatchReturnSuccessorColors provides was once non-trivial: it was a computation layered on top of funclet coloring.
[WinEH] Remove calculateCatchReturnSuccessorColors
The functionality that calculateCatchReturnSuccessorColors provides was once non-trivial: it was a computation layered on top of funclet coloring.
These days, LLVM IR directly encodes what calculateCatchReturnSuccessorColors computed, obsoleting the need for it.
No functionality change is intended.
llvm-svn: 256965
show more ...
|
#
52f729a6 |
| 04-Jan-2016 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Update CoreCLR EH state numbering
Summary: Fix the CLR state numbering to generate correct tables, and update the lit test to verify them.
The CLR numbering assigns one state number to each
[WinEH] Update CoreCLR EH state numbering
Summary: Fix the CLR state numbering to generate correct tables, and update the lit test to verify them.
The CLR numbering assigns one state number to each catchpad and cleanuppad.
It also computes two tree-like relations over states: 1) Each state has a "HandlerParentState", which is the state of the next outer handler enclosing this state's handler (same as nearest ancestor per the ParentPad linkage on EH pads, but skipping over catchswitches). 2) Each state has a "TryParentState", which: a) for a catchpad that's not the last handler on its catchswitch, is the state of the next catchpad on that catchswitch. b) for all other pads, is the state of the pad whose try region is the next outer try region enclosing this state's try region. The "try regions are not present as such in the IR, but will be inferred based on the placement of invokes and pads which reach each other by exceptional exits.
Catchswitches do not get their own states, but each gets mapped to the state of its first catchpad.
Table generation requires each state's "unwind dest" state to have a lower state number than the given state.
Since HandlerParentState can be computed as a function of a pad's ParentPad, and TryParentState can be computed as a function of its unwind dest and the TryParentStates of its children, the CLR state numbering algorithm first computes HandlerParentState in a top-down pass, then computes TryParentState in a bottom-up pass.
Also reword some comments/names in the CLR EH table generation to make the distinction between the different kinds of "parent" clear.
Reviewers: rnk, andrew.w.kaylor, majnemer
Subscribers: AndyAyers, llvm-commits
Differential Revision: http://reviews.llvm.org/D15325
llvm-svn: 256760
show more ...
|
#
ded575e4 |
| 03-Jan-2016 |
NAKAMURA Takumi <geek4civic@gmail.com> |
WinEHPrepare.cpp: Suppress a warning for -Asserts. [-Wunused-variable]
llvm-svn: 256694
|
#
71e5676d |
| 02-Jan-2016 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Update catchrets with cloned successors
Summary: Add a pass to update catchrets when their successors get cloned; the existing pass doesn't catch these because it walks the funclet whose blo
[WinEH] Update catchrets with cloned successors
Summary: Add a pass to update catchrets when their successors get cloned; the existing pass doesn't catch these because it walks the funclet whose blocks are being cloned but the catchret is in a child funclet.
Also update the test for removing incoming PHI values; when the predecessor is a catchret, the relevant color is the catchret's parentPad, not its block's color.
Reviewers: andrew.w.kaylor, rnk, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15840
llvm-svn: 256689
show more ...
|
#
dbdc9c27 |
| 02-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Add additional verification
Recolor the IR to make sure our computed colors are not hiding any bugs. Also, verifyFunction if we are running some post-preparation operations; some of these op
[WinEH] Add additional verification
Recolor the IR to make sure our computed colors are not hiding any bugs. Also, verifyFunction if we are running some post-preparation operations; some of these operations can hide latent bugs.
llvm-svn: 256687
show more ...
|
#
e0115344 |
| 29-Dec-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[ptr-traits] Sink a constructor definition to the .cpp file and add missing includes so that the pointee types for DenseMap pointer keys and such are complete prior to us querying the pointer traits
[ptr-traits] Sink a constructor definition to the .cpp file and add missing includes so that the pointee types for DenseMap pointer keys and such are complete prior to us querying the pointer traits for them.
This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero.
llvm-svn: 256550
show more ...
|
#
c640f863 |
| 23-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Don't visit the same catchswitch twice
We visited the same catchswitch twice because it was both the child of another funclet and the predecessor of a cleanuppad.
Instead, change the number
[WinEH] Don't visit the same catchswitch twice
We visited the same catchswitch twice because it was both the child of another funclet and the predecessor of a cleanuppad.
Instead, change the numbering algorithm to only recurse if the unwind destination of the inner funclet agrees with the unwind destination of the catchswitch.
This fixes PR25926.
llvm-svn: 256317
show more ...
|
#
3bb88c02 |
| 15-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in unreachable which, in turn, makes it possible for an invoke to end up in a funclet wh
[WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in unreachable which, in turn, makes it possible for an invoke to end up in a funclet which it was not originally part of.
Using operand bundles on invokes allows us to determine whether or not an invoke was part of a funclet in the source program.
Furthermore, it allows us to unambiguously answer questions about the legality of inlining into call sites which the personality may have trouble with.
Differential Revision: http://reviews.llvm.org/D15517
llvm-svn: 255674
show more ...
|
#
bbfc7219 |
| 14-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[IR] Remove terminatepad
It turns out that terminatepad gives little benefit over a cleanuppad which calls the termination function. This is not sufficient to implement fully generic filters but MS
[IR] Remove terminatepad
It turns out that terminatepad gives little benefit over a cleanuppad which calls the termination function. This is not sufficient to implement fully generic filters but MSVC doesn't support them which makes terminatepad a little over-designed.
Depends on D15478.
Differential Revision: http://reviews.llvm.org/D15479
llvm-svn: 255522
show more ...
|
#
8a1c45d6 |
| 12-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[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
[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
show more ...
|
#
70497c69 |
| 02-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
Move EH-specific helper functions to a more appropriate place
No functionality change is intended.
llvm-svn: 254562
|
Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2 |
|
#
cc2f6c35 |
| 19-Nov-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Disable most forms of demotion
Now that the register allocator knows about the barriers on funclet entry and exit, testing has shown that this is unnecessary.
We still demote PHIs on unspli
[WinEH] Disable most forms of demotion
Now that the register allocator knows about the barriers on funclet entry and exit, testing has shown that this is unnecessary.
We still demote PHIs on unsplittable blocks due to the differences between the IR CFG and the Machine CFG.
llvm-svn: 253619
show more ...
|
Revision tags: llvmorg-3.7.1-rc1 |
|
#
fb16a3ac |
| 12-Nov-2015 |
Andrew Kaylor <andrew.kaylor@intel.com> |
[WinEH] Fix problem with removing an element from a SetVector while iterating.
Patch provided by Yaron Keren. (Thanks!)
llvm-svn: 252913
|
#
fdd48fa1 |
| 09-Nov-2015 |
Andrew Kaylor <andrew.kaylor@intel.com> |
[WinEH] Re-committing r252249 (Clone funclets with multiple parents) with additional fixes for determinism problems
Differential Revision: http://reviews.llvm.org/D14454
llvm-svn: 252508
|
#
9947cace |
| 06-Nov-2015 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Revert r252249 (and r252255, r252258), "[WinEH] Clone funclets with multiple parents"
It behaved flaky due to iterating pointer key values on std::set and std::map.
llvm-svn: 252279
|
#
f477585a |
| 06-Nov-2015 |
Andrew Kaylor <andrew.kaylor@intel.com> |
Fix build warnings
llvm-svn: 252255
|
#
29cd5765 |
| 06-Nov-2015 |
Andrew Kaylor <andrew.kaylor@intel.com> |
[WinEH] Clone funclets with multiple parents
Windows EH funclets need to always return to a single parent funclet. However, it is possible for earlier optimizations to combine funclets (probably ba
[WinEH] Clone funclets with multiple parents
Windows EH funclets need to always return to a single parent funclet. However, it is possible for earlier optimizations to combine funclets (probably based on one funclet having an unreachable terminator) in such a way that this condition is violated.
These changes add code to the WinEHPrepare pass to detect situations where a funclet has multiple parents and clone such funclets, fixing up the unwind and catch return edges so that each copy of the funclet returns to the correct parent funclet.
Differential Revision: http://reviews.llvm.org/D13274?id=39098
llvm-svn: 252249
show more ...
|
#
d11a998e |
| 16-Oct-2015 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Fix CatchRetSuccessorColorMap accounting
Summary: We now use the block for the catchpad itself, rather than its normal successor, as the funclet entry. Putting the normal successor in the ma
[WinEH] Fix CatchRetSuccessorColorMap accounting
Summary: We now use the block for the catchpad itself, rather than its normal successor, as the funclet entry. Putting the normal successor in the map leads downstream funclet membership computations to erroneous results.
Reviewers: majnemer, rnk
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D13798
llvm-svn: 250552
show more ...
|
#
e696583d |
| 16-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Remove dead code/includes from WinEHPrepare
No functionality change is intended.
llvm-svn: 250545
|
#
53e9cbd9 |
| 16-Oct-2015 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Fix endpad coloring/numbering
Summary: When a cleanup's cleanupendpad or cleanupret targets a catchendpad, stop trying to propagate the cleanup's parent's color to the catchendpad, since wha
[WinEH] Fix endpad coloring/numbering
Summary: When a cleanup's cleanupendpad or cleanupret targets a catchendpad, stop trying to propagate the cleanup's parent's color to the catchendpad, since what's needed is the cleanup's grandparent's color and the catchendpad will get that color from the catchpad linkage already. We already had this exclusion for invokes, but were missing it for cleanupendpad/cleanupret.
Also add a missing line that tags cleanupendpads' states in the EHPadStateMap, without with lowering invokes that target cleanupendpads which unwind to other handlers (and so don't have the -1 state) will fail.
This fixes the reduced IR repro in PR25163.
Reviewers: majnemer, andrew.w.kaylor, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13797
llvm-svn: 250534
show more ...
|
#
99c1d13e |
| 12-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Remove CatchObjRecoverIdx
CatchObjRecoverIdx was used for the old scheme, it is no longer relevant.
llvm-svn: 250065
|
#
bfa5b982 |
| 10-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Remove more dead code
wineh-parent is dead, so is ValueOrMBB.
llvm-svn: 249920
|
#
14e77350 |
| 09-Oct-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Delete the old landingpad implementation of Windows EH
The new implementation works at least as well as the old implementation did.
Also delete the associated preparation tests. They don't
[WinEH] Delete the old landingpad implementation of Windows EH
The new implementation works at least as well as the old implementation did.
Also delete the associated preparation tests. They don't exercise interesting corner cases of the new implementation. All the codegen tests of the EH tables have already been ported.
llvm-svn: 249918
show more ...
|