diff options
author | Reid Kleckner <rnk@google.com> | 2019-09-03 22:27:27 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-09-03 22:27:27 +0000 |
commit | 3fa07dee94368643cdbc38fb24d8d2734b9bf42c (patch) | |
tree | 47b305d9f92cc54ae59568aa30c4a0c358645563 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | 49e7ee4dd58f57b67d3f1b953d2f81ae6ad75964 (diff) | |
download | bcm5719-llvm-3fa07dee94368643cdbc38fb24d8d2734b9bf42c.tar.gz bcm5719-llvm-3fa07dee94368643cdbc38fb24d8d2734b9bf42c.zip |
Revert [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn
This reverts r370525 (git commit 0bb1630685fba255fa93def92603f064c2ffd203)
Also reverts r370543 (git commit 185ddc08eed6542781040b8499ef7ad15c8ae9f4)
The approach I took only works for functions marked `noreturn`. In
general, a call that is not known to be noreturn may be followed by
unreachable for other reasons. For example, there could be multiple call
sites to a function that throws sometimes, and at some call sites, it is
known to always throw, so it is followed by unreachable. We need to
insert an `int3` in these cases to pacify the Windows unwinder.
I think this probably deserves its own standalone, Win64-only fixup pass
that runs after block placement. Implementing that will take some time,
so let's revert to TrapUnreachable in the mean time.
llvm-svn: 370829
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 90ea103ac8f..3cc45a7add1 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -4101,17 +4101,6 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, InFlag = Chain.getValue(1); } - // Insert a pseudo instruction after noreturn calls that expands to int3 if - // this would be the last instruction in the funclet. If the return address of - // a call refers to the last PC of a function, the Windows SEH machinery can - // get confused about which function or scope the return address belongs to. - // MSVC inserts int3 after every noreturn function call, but LLVM only places - // them when it would cause a problem otherwise. - if (CLI.DoesNotReturn && Subtarget.isTargetWin64()) { - Chain = DAG.getNode(X86ISD::SEH_NORETURN, dl, NodeTys, Chain, InFlag); - InFlag = Chain.getValue(1); - } - // Handle result values, copying them out of physregs into vregs that we // return. return LowerCallResult(Chain, InFlag, CallConv, isVarArg, Ins, dl, DAG, @@ -28729,7 +28718,6 @@ const char *X86TargetLowering::getTargetNodeName(unsigned Opcode) const { case X86ISD::VASTART_SAVE_XMM_REGS: return "X86ISD::VASTART_SAVE_XMM_REGS"; case X86ISD::VAARG_64: return "X86ISD::VAARG_64"; case X86ISD::WIN_ALLOCA: return "X86ISD::WIN_ALLOCA"; - case X86ISD::SEH_NORETURN: return "X86ISD::SEH_NORETURN"; case X86ISD::MEMBARRIER: return "X86ISD::MEMBARRIER"; case X86ISD::MFENCE: return "X86ISD::MFENCE"; case X86ISD::SEG_ALLOCA: return "X86ISD::SEG_ALLOCA"; |