#
32ac273a |
| 17-Feb-2016 |
Nico Weber <nicolasweber@gmx.de> |
Remove superfluous semicolon.
llvm-svn: 261128
|
#
7e5937b7 |
| 17-Feb-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Optimize WinEH state stores
32-bit x86 Windows targets use a linked-list of nodes allocated on the stack, referenced to via thread-local storage. The personality routine interprets one of t
[WinEH] Optimize WinEH state stores
32-bit x86 Windows targets use a linked-list of nodes allocated on the stack, referenced to via thread-local storage. The personality routine interprets one of the fields in the node as a 'state number' which indicates where the personality routine should transfer control.
State transitions are possible only before call-sites which may throw exceptions. Our previous scheme had us update the state number before all call-sites which may throw.
Instead, we can try to minimize the number of times we need to store by reasoning about the nearest store which dominates the current call-site. If the last store agrees with the current call-site, then we know that the state-update is redundant and can be elided.
This is largely straightforward: an RPO walk of the blocks allows us to correctly forward propagate the information when the function is a DAG. Currently, loops are not handled optimally and may trigger superfluous state stores.
Differential Revision: http://reviews.llvm.org/D16763
llvm-svn: 261122
show more ...
|
Revision tags: llvmorg-3.8.0-rc2 |
|
#
efb41741 |
| 01-Feb-2016 |
David Majnemer <david.majnemer@gmail.com> |
[X86] Cleanup the WinEHState pass
Remove unnecessary includes and class state.
No functional change intended.
llvm-svn: 259340
|
#
f2bb710d |
| 29-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Don't perform state stores in cleanups
Our cleanups do not support true lexical nesting of funclets which obviates the need to perform state stores.
This fixes PR26361.
llvm-svn: 259161
|
Revision tags: llvmorg-3.8.0-rc1 |
|
#
d7045faa |
| 15-Dec-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Remove unused intrinsic llvm.x86.seh.restoreframe
We can clean this up now that we have the X86 CATCHRET instruction to restore the FP, SP, and BP.
llvm-svn: 255677
|
#
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 |
|
#
c20276d0 |
| 17-Nov-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction
Summary: Now that there is a one-to-one mapping from MachineFunction to WinEHFuncInfo, we don't need to use a DenseMap to select
[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction
Summary: Now that there is a one-to-one mapping from MachineFunction to WinEHFuncInfo, we don't need to use a DenseMap to select the right WinEHFuncInfo for the current funclet.
The main challenge here is that X86WinEHStatePass is an IR pass that doesn't have access to the MachineFunction. I gave it its own WinEHFuncInfo object that it uses to calculate state numbers, which it then throws away. As long as nobody creates or removes EH pads between this pass and SDAG construction, we will get the same state numbers.
The other thing X86WinEHStatePass does is to mark the EH registration node. Instead of communicating which alloca was the registration through WinEHFuncInfo, I added the llvm.x86.seh.ehregnode intrinsic. This intrinsic generates no code and simply marks the alloca in use.
Reviewers: JCTremoulet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14668
llvm-svn: 253378
show more ...
|
Revision tags: llvmorg-3.7.1-rc1 |
|
#
d77de649 |
| 19-Oct-2015 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
X86: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250741
|
#
5dfcda73 |
| 15-Oct-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
[X86] Rip out orphaned method declarations and other dead code. NFC.
llvm-svn: 250406
|
#
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 ...
|
#
2afea543 |
| 06-Oct-2015 |
Joseph Tremoulet <jotrem@microsoft.com> |
[WinEH] Recognize CoreCLR personality function
Summary: - Add CoreCLR to if/else ladders and switches as appropriate. - Rename isMSVCEHPersonality to isFuncletEHPersonality to better reflect wh
[WinEH] Recognize CoreCLR personality function
Summary: - Add CoreCLR to if/else ladders and switches as appropriate. - Rename isMSVCEHPersonality to isFuncletEHPersonality to better reflect what it captures.
Reviewers: majnemer, andrew.w.kaylor, rnk
Subscribers: pgavlin, AndyAyers, llvm-commits
Differential Revision: http://reviews.llvm.org/D13449
llvm-svn: 249455
show more ...
|
#
5b8a46e7 |
| 17-Sep-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Make funclet return instrs pseudo instrs
This makes catchret look more like a branch, and less like a weird use of BlockAddress. It also lets us get away from llvm.x86.seh.restoreframe, whic
[WinEH] Make funclet return instrs pseudo instrs
This makes catchret look more like a branch, and less like a weird use of BlockAddress. It also lets us get away from llvm.x86.seh.restoreframe, which relies on the old parentfpoffset label arithmetic.
llvm-svn: 247936
show more ...
|
#
813f1b65 |
| 16-Sep-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Rip out the landingpad-based C++ EH state numbering code
It never really worked, and the new code is working better every day.
llvm-svn: 247860
|
#
84ebff4a |
| 16-Sep-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Skip state numbering when no EH pads are present
Otherwise we'd try to emit the thunk that passes the LSDA to __CxxFrameHandler3. We don't emit the LSDA if there were no landingpads, so we'd
[WinEH] Skip state numbering when no EH pads are present
Otherwise we'd try to emit the thunk that passes the LSDA to __CxxFrameHandler3. We don't emit the LSDA if there were no landingpads, so we'd end up with an assembler error when trying to write the COFF object.
llvm-svn: 247820
show more ...
|
#
94b704c4 |
| 09-Sep-2015 |
Reid Kleckner <rnk@google.com> |
[SEH] Emit 32-bit SEH tables for the new EH IR
The 32-bit tables don't actually contain PC range data, so emitting them is incredibly simple.
The 64-bit tables, on the other hand, use the same tabl
[SEH] Emit 32-bit SEH tables for the new EH IR
The 32-bit tables don't actually contain PC range data, so emitting them is incredibly simple.
The 64-bit tables, on the other hand, use the same table for state numbering as well as label ranges. This makes things more difficult, so it will be implemented later.
llvm-svn: 247192
show more ...
|
#
df129517 |
| 08-Sep-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Emit prologues and epilogues for funclets
Summary: 32-bit funclets have short prologues that allocate enough stack for the largest call in the whole function. The runtime saves CSRs for the
[WinEH] Emit prologues and epilogues for funclets
Summary: 32-bit funclets have short prologues that allocate enough stack for the largest call in the whole function. The runtime saves CSRs for the funclet. It doesn't restore CSRs after we finally transfer control back to the parent funciton via a CATCHRET, but that's a separate issue. 32-bit funclets also have to adjust the incoming EBP value, which is what llvm.x86.seh.recoverframe does in the old model.
64-bit funclets need to spill CSRs as normal. For simplicity, this just spills the same set of CSRs as the parent function, rather than trying to compute different CSR sets for the parent function and each funclet. 64-bit funclets also allocate enough stack space for the largest outgoing call frame, like 32-bit.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12546
llvm-svn: 247092
show more ...
|
#
0e288234 |
| 27-Aug-2015 |
Reid Kleckner <rnk@google.com> |
[WinEH] Add some support for code generating catchpad
We can now run 32-bit programs with empty catch bodies. The next step is to change PEI so that we get funclet prologues and epilogues.
llvm-sv
[WinEH] Add some support for code generating catchpad
We can now run 32-bit programs with empty catch bodies. The next step is to change PEI so that we get funclet prologues and epilogues.
llvm-svn: 246235
show more ...
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3 |
|
#
0ad363ee |
| 18-Aug-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Calculate state numbers for the new EH representation
State numbers are calculated by performing a walk from the innermost funclet to the outermost funclet. Rudimentary support for the new
[WinEH] Calculate state numbers for the new EH representation
State numbers are calculated by performing a walk from the innermost funclet to the outermost funclet. Rudimentary support for the new EH constructs has been added to the assembly printer, just enough to test the new machinery.
Differential Revision: http://reviews.llvm.org/D12098
llvm-svn: 245331
show more ...
|
Revision tags: studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1 |
|
#
5f4dd922 |
| 13-Jul-2015 |
Reid Kleckner <reid@kleckner.net> |
[WinEH] Strip the \01 character from the __CxxFrameHandler3 thunk name
Add another C++ 32-bit EH table test.
llvm-svn: 242044
|
#
85a2450d |
| 10-Jul-2015 |
Reid Kleckner <reid@kleckner.net> |
[WinEH] Make sure LSDA tables are 4 byte aligned
Apparently this is important, otherwise _except_handler3 assumes that the registration node is corrupted and ignores it.
Also fix a bug in WinEHPrep
[WinEH] Make sure LSDA tables are 4 byte aligned
Apparently this is important, otherwise _except_handler3 assumes that the registration node is corrupted and ignores it.
Also fix a bug in WinEHPrepare where we would insert code after a terminator instruction.
llvm-svn: 241877
show more ...
|
#
ed012dbf |
| 08-Jul-2015 |
Reid Kleckner <reid@kleckner.net> |
[SEH] Ensure that empty __except blocks have their own BB
The 32-bit lowering assumed that WinEHPrepare had this invariant. WinEHPrepare did it for C++, but not SEH. The result was that we would ins
[SEH] Ensure that empty __except blocks have their own BB
The 32-bit lowering assumed that WinEHPrepare had this invariant. WinEHPrepare did it for C++, but not SEH. The result was that we would insert calls to llvm.x86.seh.restoreframe in normal basic blocks, which corrupted the frame pointer.
llvm-svn: 241699
show more ...
|
#
60381791 |
| 07-Jul-2015 |
Reid Kleckner <reid@kleckner.net> |
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary: Initially, these intrinsics seemed like part of a family of "frame" related intrinsics, but now I think that's
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary: Initially, these intrinsics seemed like part of a family of "frame" related intrinsics, but now I think that's more confusing than helpful. Initially, the LangRef specified that this would create a new kind of allocation that would be allocated at a fixed offset from the frame pointer (EBP/RBP). We ended up dropping that design, and leaving the stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not frame pointers. I intend to go further and add an `llvm.localaddress()` intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being used to address locals, which should not be confused with the frame pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
llvm-svn: 241633
show more ...
|
#
399a2fe4 |
| 30-Jun-2015 |
Reid Kleckner <reid@kleckner.net> |
[SEH] Add new intrinsics for recovering and restoring parent frames
The incoming EBP value established by the runtime is actually a pointer to the end of the EH registration object, and not the true
[SEH] Add new intrinsics for recovering and restoring parent frames
The incoming EBP value established by the runtime is actually a pointer to the end of the EH registration object, and not the true parent function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo anymore because we know that the exception info pointer is at a fixed offset from this incoming EBP.
The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the EH runtime and returns a pointer that is usable with llvm.framerecover.
The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit specific preparation pass in blocks targetted by the EH runtime. It re-establishes any physical registers used by the parent function to address the stack, such as the frame, base, and stack pointers.
Neither of these intrinsics correctly handle stack realignment prologues yet, but it's possible to add that later.
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D10848
llvm-svn: 241125
show more ...
|