mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
Reapply "[CodeGen] [WinException] Only produce handler data at the end of the function if needed"
This reapplies 36c64af9d7f97414d48681b74352c9684077259b in updated form. Emit the xdata for each function at .seh_endproc. This keeps the exact same output header order for most code generated by the LLVM CodeGen layer. (Sections still change order for code built from assembly where functions lack an explicit .seh_handlerdata directive, and functions with chained unwind info.) The practical effect should be that assembly output lacks superfluous ".seh_handlerdata; .text" pairs at the end of functions that don't handle exceptions, which allows such functions to use the AArch64 packed unwind format again. Differential Revision: https://reviews.llvm.org/D87448
This commit is contained in:
parent
f4f69878dc
commit
0f20d48a09
@ -206,6 +206,7 @@ class MCStreamer {
|
||||
std::vector<std::unique_ptr<WinEH::FrameInfo>> WinFrameInfos;
|
||||
|
||||
WinEH::FrameInfo *CurrentWinFrameInfo;
|
||||
size_t CurrentProcWinFrameInfoStartIndex;
|
||||
|
||||
/// Tracks an index to represent the order a symbol was emitted in.
|
||||
/// Zero means we did not emit that symbol.
|
||||
@ -244,6 +245,8 @@ protected:
|
||||
return CurrentWinFrameInfo;
|
||||
}
|
||||
|
||||
virtual void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame);
|
||||
|
||||
virtual void EmitWindowsUnwindTables();
|
||||
|
||||
virtual void emitRawTextImpl(StringRef String);
|
||||
|
@ -53,14 +53,15 @@ struct Instruction {
|
||||
class UnwindEmitter : public WinEH::UnwindEmitter {
|
||||
public:
|
||||
void Emit(MCStreamer &Streamer) const override;
|
||||
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI) const override;
|
||||
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
|
||||
bool HandlerData) const override;
|
||||
};
|
||||
|
||||
class ARM64UnwindEmitter : public WinEH::UnwindEmitter {
|
||||
public:
|
||||
void Emit(MCStreamer &Streamer) const override;
|
||||
void EmitUnwindInfo(MCStreamer &Streamer,
|
||||
WinEH::FrameInfo *FI) const override;
|
||||
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
|
||||
bool HandlerData) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -80,7 +80,8 @@ public:
|
||||
|
||||
/// This emits the unwind info sections (.pdata and .xdata in PE/COFF).
|
||||
virtual void Emit(MCStreamer &Streamer) const = 0;
|
||||
virtual void EmitUnwindInfo(MCStreamer &Streamer, FrameInfo *FI) const = 0;
|
||||
virtual void EmitUnwindInfo(MCStreamer &Streamer, FrameInfo *FI,
|
||||
bool HandlerData) const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -258,11 +258,11 @@ void WinException::endFuncletImpl() {
|
||||
if (F.hasPersonalityFn())
|
||||
Per = classifyEHPersonality(F.getPersonalityFn()->stripPointerCasts());
|
||||
|
||||
// Emit an UNWIND_INFO struct describing the prologue.
|
||||
Asm->OutStreamer->EmitWinEHHandlerData();
|
||||
|
||||
if (Per == EHPersonality::MSVC_CXX && shouldEmitPersonality &&
|
||||
!CurrentFuncletEntry->isCleanupFuncletEntry()) {
|
||||
// Emit an UNWIND_INFO struct describing the prologue.
|
||||
Asm->OutStreamer->EmitWinEHHandlerData();
|
||||
|
||||
// If this is a C++ catch funclet (or the parent function),
|
||||
// emit a reference to the LSDA for the parent function.
|
||||
StringRef FuncLinkageName = GlobalValue::dropLLVMManglingEscape(F.getName());
|
||||
@ -271,9 +271,22 @@ void WinException::endFuncletImpl() {
|
||||
Asm->OutStreamer->emitValue(create32bitRef(FuncInfoXData), 4);
|
||||
} else if (Per == EHPersonality::MSVC_TableSEH && MF->hasEHFunclets() &&
|
||||
!CurrentFuncletEntry->isEHFuncletEntry()) {
|
||||
// Emit an UNWIND_INFO struct describing the prologue.
|
||||
Asm->OutStreamer->EmitWinEHHandlerData();
|
||||
|
||||
// If this is the parent function in Win64 SEH, emit the LSDA immediately
|
||||
// following .seh_handlerdata.
|
||||
emitCSpecificHandlerTable(MF);
|
||||
} else if (shouldEmitPersonality || shouldEmitLSDA) {
|
||||
// Emit an UNWIND_INFO struct describing the prologue.
|
||||
Asm->OutStreamer->EmitWinEHHandlerData();
|
||||
// In these cases, no further info is written to the .xdata section
|
||||
// right here, but is written by e.g. emitExceptionTable in endFunction()
|
||||
// above.
|
||||
} else {
|
||||
// No need to emit the EH handler data right here if nothing needs
|
||||
// writing to the .xdata section; it will be emitted for all
|
||||
// functions that need it in the end anyway.
|
||||
}
|
||||
|
||||
// Switch back to the funclet start .text section now that we are done
|
||||
|
@ -90,7 +90,7 @@ void MCTargetStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
|
||||
|
||||
MCStreamer::MCStreamer(MCContext &Ctx)
|
||||
: Context(Ctx), CurrentWinFrameInfo(nullptr),
|
||||
UseAssemblerInfoForParsing(false) {
|
||||
CurrentProcWinFrameInfoStartIndex(0), UseAssemblerInfoForParsing(false) {
|
||||
SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
|
||||
}
|
||||
|
||||
@ -692,6 +692,7 @@ void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc) {
|
||||
|
||||
MCSymbol *StartProc = emitCFILabel();
|
||||
|
||||
CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
|
||||
WinFrameInfos.emplace_back(
|
||||
std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
|
||||
CurrentWinFrameInfo = WinFrameInfos.back().get();
|
||||
@ -709,6 +710,11 @@ void MCStreamer::EmitWinCFIEndProc(SMLoc Loc) {
|
||||
CurFrame->End = Label;
|
||||
if (!CurFrame->FuncletOrFuncEnd)
|
||||
CurFrame->FuncletOrFuncEnd = CurFrame->End;
|
||||
|
||||
for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
|
||||
I != E; ++I)
|
||||
EmitWindowsUnwindTables(WinFrameInfos[I].get());
|
||||
SwitchSection(CurFrame->TextSection);
|
||||
}
|
||||
|
||||
void MCStreamer::EmitWinCFIFuncletOrFuncEnd(SMLoc Loc) {
|
||||
@ -967,6 +973,9 @@ void MCStreamer::emitRawText(const Twine &T) {
|
||||
void MCStreamer::EmitWindowsUnwindTables() {
|
||||
}
|
||||
|
||||
void MCStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) {
|
||||
}
|
||||
|
||||
void MCStreamer::Finish(SMLoc EndLoc) {
|
||||
if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
|
||||
(!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
|
||||
|
@ -238,8 +238,9 @@ void llvm::Win64EH::UnwindEmitter::Emit(MCStreamer &Streamer) const {
|
||||
}
|
||||
}
|
||||
|
||||
void llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(
|
||||
MCStreamer &Streamer, WinEH::FrameInfo *info) const {
|
||||
void llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
|
||||
WinEH::FrameInfo *info,
|
||||
bool HandlerData) const {
|
||||
// Switch sections (the static function above is meant to be called from
|
||||
// here and from Emit().
|
||||
MCSection *XData = Streamer.getAssociatedXDataSection(info->TextSection);
|
||||
@ -1107,8 +1108,9 @@ void llvm::Win64EH::ARM64UnwindEmitter::Emit(MCStreamer &Streamer) const {
|
||||
}
|
||||
}
|
||||
|
||||
void llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(
|
||||
MCStreamer &Streamer, WinEH::FrameInfo *info) const {
|
||||
void llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
|
||||
WinEH::FrameInfo *info,
|
||||
bool HandlerData) const {
|
||||
// Called if there's an .seh_handlerdata directive before the end of the
|
||||
// function. This forces writing the xdata record already here - and
|
||||
// in this case, the function isn't actually ended already, but the xdata
|
||||
@ -1123,5 +1125,5 @@ void llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(
|
||||
// here and from Emit().
|
||||
MCSection *XData = Streamer.getAssociatedXDataSection(info->TextSection);
|
||||
Streamer.SwitchSection(XData);
|
||||
ARM64EmitUnwindInfo(Streamer, info, false);
|
||||
ARM64EmitUnwindInfo(Streamer, info, /* TryPacked = */ !HandlerData);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
|
||||
void EmitWinEHHandlerData(SMLoc Loc) override;
|
||||
void EmitWindowsUnwindTables() override;
|
||||
void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) override;
|
||||
void finishImpl() override;
|
||||
};
|
||||
|
||||
@ -36,7 +37,12 @@ void AArch64WinCOFFStreamer::EmitWinEHHandlerData(SMLoc Loc) {
|
||||
|
||||
// We have to emit the unwind info now, because this directive
|
||||
// actually switches to the .xdata section!
|
||||
EHStreamer.EmitUnwindInfo(*this, getCurrentWinFrameInfo());
|
||||
EHStreamer.EmitUnwindInfo(*this, getCurrentWinFrameInfo(),
|
||||
/* HandlerData = */ true);
|
||||
}
|
||||
|
||||
void AArch64WinCOFFStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) {
|
||||
EHStreamer.EmitUnwindInfo(*this, Frame, /* HandlerData = */ false);
|
||||
}
|
||||
|
||||
void AArch64WinCOFFStreamer::EmitWindowsUnwindTables() {
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
: MCWinCOFFStreamer(C, std::move(AB), std::move(CE), std::move(OW)) {}
|
||||
|
||||
void EmitWinEHHandlerData(SMLoc Loc) override;
|
||||
void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) override;
|
||||
void EmitWindowsUnwindTables() override;
|
||||
void EmitCVFPOData(const MCSymbol *ProcSym, SMLoc Loc) override;
|
||||
void finishImpl() override;
|
||||
@ -37,7 +38,11 @@ void X86WinCOFFStreamer::EmitWinEHHandlerData(SMLoc Loc) {
|
||||
// We have to emit the unwind info now, because this directive
|
||||
// actually switches to the .xdata section.
|
||||
if (WinEH::FrameInfo *CurFrame = getCurrentWinFrameInfo())
|
||||
EHStreamer.EmitUnwindInfo(*this, CurFrame);
|
||||
EHStreamer.EmitUnwindInfo(*this, CurFrame, /* HandlerData = */ true);
|
||||
}
|
||||
|
||||
void X86WinCOFFStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) {
|
||||
EHStreamer.EmitUnwindInfo(*this, Frame, /* HandlerData = */ false);
|
||||
}
|
||||
|
||||
void X86WinCOFFStreamer::EmitWindowsUnwindTables() {
|
||||
|
@ -44,8 +44,6 @@ declare void @g(i32, i32)
|
||||
; CHECK: .word .LBB0_3-.Ltmp0
|
||||
; CHECK: .word .LBB0_4-.Ltmp0
|
||||
; CHECK: .word .LBB0_5-.Ltmp0
|
||||
; CHECK: .seh_handlerdata
|
||||
; CHECK: .text
|
||||
; CHECK: .seh_endproc
|
||||
|
||||
; Check that we can emit an object file with correct unwind info.
|
||||
|
@ -73,8 +73,6 @@
|
||||
# ASM: .seh_endepilogue
|
||||
|
||||
# ASM: .seh_endfunclet
|
||||
# ASM: .seh_handlerdata
|
||||
# ASM: .text
|
||||
# ASM: .seh_endproc
|
||||
|
||||
...
|
||||
|
@ -423,8 +423,6 @@ define <16 x float> @testf16_inp_mask(<16 x float> %a, i16 %mask) {
|
||||
; WIN64-KNL-NEXT: nop
|
||||
; WIN64-KNL-NEXT: addq $40, %rsp
|
||||
; WIN64-KNL-NEXT: retq
|
||||
; WIN64-KNL-NEXT: .seh_handlerdata
|
||||
; WIN64-KNL-NEXT: .text
|
||||
; WIN64-KNL-NEXT: .seh_endproc
|
||||
;
|
||||
; WIN64-SKX-LABEL: testf16_inp_mask:
|
||||
@ -439,8 +437,6 @@ define <16 x float> @testf16_inp_mask(<16 x float> %a, i16 %mask) {
|
||||
; WIN64-SKX-NEXT: nop
|
||||
; WIN64-SKX-NEXT: addq $40, %rsp
|
||||
; WIN64-SKX-NEXT: retq
|
||||
; WIN64-SKX-NEXT: .seh_handlerdata
|
||||
; WIN64-SKX-NEXT: .text
|
||||
; WIN64-SKX-NEXT: .seh_endproc
|
||||
;
|
||||
; X64-KNL-LABEL: testf16_inp_mask:
|
||||
|
@ -157,8 +157,6 @@ define i64 @caller_argv64i1() #0 {
|
||||
; WIN64-NEXT: popq %r14
|
||||
; WIN64-NEXT: popq %r15
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_argv64i1:
|
||||
@ -263,8 +261,6 @@ define <64 x i1> @caller_retv64i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_retv64i1:
|
||||
@ -349,8 +345,6 @@ define x86_regcallcc i32 @test_argv32i1(<32 x i1> %x0, <32 x i1> %x1, <32 x i1>
|
||||
; WIN64-NEXT: popq %r11
|
||||
; WIN64-NEXT: popq %rbp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_argv32i1:
|
||||
@ -438,8 +432,6 @@ define i32 @caller_argv32i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_argv32i1:
|
||||
@ -503,8 +495,6 @@ define i32 @caller_retv32i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_retv32i1:
|
||||
@ -584,8 +574,6 @@ define x86_regcallcc i16 @test_argv16i1(<16 x i1> %x0, <16 x i1> %x1, <16 x i1>
|
||||
; WIN64-NEXT: popq %r10
|
||||
; WIN64-NEXT: popq %r11
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_argv16i1:
|
||||
@ -672,8 +660,6 @@ define i16 @caller_argv16i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_argv16i1:
|
||||
@ -741,8 +727,6 @@ define i16 @caller_retv16i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_retv16i1:
|
||||
@ -824,8 +808,6 @@ define x86_regcallcc i8 @test_argv8i1(<8 x i1> %x0, <8 x i1> %x1, <8 x i1> %x2)
|
||||
; WIN64-NEXT: popq %r10
|
||||
; WIN64-NEXT: popq %r11
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_argv8i1:
|
||||
@ -912,8 +894,6 @@ define i8 @caller_argv8i1() #0 {
|
||||
; WIN64-NEXT: popq %rdi
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_argv8i1:
|
||||
@ -985,8 +965,6 @@ define <8 x i1> @caller_retv8i1() #0 {
|
||||
; WIN64-NEXT: popq %rsi
|
||||
; WIN64-NEXT: vzeroupper
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: caller_retv8i1:
|
||||
|
@ -49,8 +49,6 @@ define x86_regcallcc i1 @test_CallargReti1(i1 %a) {
|
||||
; WIN64-NEXT: incb %al
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargReti1:
|
||||
@ -117,8 +115,6 @@ define x86_regcallcc i8 @test_CallargReti8(i8 %a) {
|
||||
; WIN64-NEXT: incb %al
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargReti8:
|
||||
@ -187,8 +183,6 @@ define x86_regcallcc i16 @test_CallargReti16(i16 %a) {
|
||||
; WIN64-NEXT: # kill: def $ax killed $ax killed $eax
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargReti16:
|
||||
@ -251,8 +245,6 @@ define x86_regcallcc i32 @test_CallargReti32(i32 %a) {
|
||||
; WIN64-NEXT: incl %eax
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargReti32:
|
||||
@ -318,8 +310,6 @@ define x86_regcallcc i64 @test_CallargReti64(i64 %a) {
|
||||
; WIN64-NEXT: incq %rax
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargReti64:
|
||||
@ -392,8 +382,6 @@ define x86_regcallcc float @test_CallargRetFloat(float %a) {
|
||||
; WIN64-NEXT: addq $16, %rsp
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRetFloat:
|
||||
@ -474,8 +462,6 @@ define x86_regcallcc double @test_CallargRetDouble(double %a) {
|
||||
; WIN64-NEXT: addq $16, %rsp
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRetDouble:
|
||||
@ -575,8 +561,6 @@ define x86_regcallcc x86_fp80 @test_CallargRetf80(x86_fp80 %a) {
|
||||
; WIN64-NEXT: fadd %st, %st(0)
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRetf80:
|
||||
@ -616,8 +600,6 @@ define x86_regcallcc double @test_CallargParamf80(x86_fp80 %a) {
|
||||
; WIN64-NEXT: vaddsd %xmm0, %xmm0, %xmm0
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargParamf80:
|
||||
@ -680,8 +662,6 @@ define x86_regcallcc [4 x i32]* @test_CallargRetPointer([4 x i32]* %a) {
|
||||
; WIN64-NEXT: incl %eax
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRetPointer:
|
||||
@ -774,8 +754,6 @@ define x86_regcallcc <4 x i32> @test_CallargRet128Vector(<4 x i1> %x, <4 x i32>
|
||||
; WIN64-NEXT: addq $32, %rsp
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRet128Vector:
|
||||
@ -866,8 +844,6 @@ define x86_regcallcc <8 x i32> @test_CallargRet256Vector(<8 x i1> %x, <8 x i32>
|
||||
; WIN64-NEXT: addq $80, %rsp
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRet256Vector:
|
||||
@ -954,8 +930,6 @@ define x86_regcallcc <16 x i32> @test_CallargRet512Vector(<16 x i1> %x, <16 x i3
|
||||
; WIN64-NEXT: addq $176, %rsp
|
||||
; WIN64-NEXT: popq %rsp
|
||||
; WIN64-NEXT: retq
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
;
|
||||
; LINUXOSX64-LABEL: test_CallargRet512Vector:
|
||||
|
@ -519,8 +519,6 @@ define void @loopdep3() {
|
||||
; SSE-WIN-NEXT: addq $160, %rsp
|
||||
; SSE-WIN-NEXT: popq %rsi
|
||||
; SSE-WIN-NEXT: retq
|
||||
; SSE-WIN-NEXT: .seh_handlerdata
|
||||
; SSE-WIN-NEXT: .text
|
||||
; SSE-WIN-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX-LABEL: loopdep3:
|
||||
@ -597,8 +595,6 @@ define void @loopdep3() {
|
||||
; AVX-NEXT: addq $160, %rsp
|
||||
; AVX-NEXT: popq %rsi
|
||||
; AVX-NEXT: retq
|
||||
; AVX-NEXT: .seh_handlerdata
|
||||
; AVX-NEXT: .text
|
||||
; AVX-NEXT: .seh_endproc
|
||||
entry:
|
||||
br label %for.cond1.preheader
|
||||
@ -716,8 +712,6 @@ define double @inlineasmdep(i64 %arg) {
|
||||
; SSE-WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; SSE-WIN-NEXT: addq $168, %rsp
|
||||
; SSE-WIN-NEXT: retq
|
||||
; SSE-WIN-NEXT: .seh_handlerdata
|
||||
; SSE-WIN-NEXT: .text
|
||||
; SSE-WIN-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX-LABEL: inlineasmdep:
|
||||
@ -775,8 +769,6 @@ define double @inlineasmdep(i64 %arg) {
|
||||
; AVX-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; AVX-NEXT: addq $168, %rsp
|
||||
; AVX-NEXT: retq
|
||||
; AVX-NEXT: .seh_handlerdata
|
||||
; AVX-NEXT: .text
|
||||
; AVX-NEXT: .seh_endproc
|
||||
top:
|
||||
tail call void asm sideeffect "", "~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{dirflag},~{fpsr},~{flags}"()
|
||||
@ -879,8 +871,6 @@ define double @truedeps(float %arg) {
|
||||
; SSE-WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; SSE-WIN-NEXT: addq $184, %rsp
|
||||
; SSE-WIN-NEXT: retq
|
||||
; SSE-WIN-NEXT: .seh_handlerdata
|
||||
; SSE-WIN-NEXT: .text
|
||||
; SSE-WIN-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX-LABEL: truedeps:
|
||||
@ -942,8 +932,6 @@ define double @truedeps(float %arg) {
|
||||
; AVX-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; AVX-NEXT: addq $184, %rsp
|
||||
; AVX-NEXT: retq
|
||||
; AVX-NEXT: .seh_handlerdata
|
||||
; AVX-NEXT: .text
|
||||
; AVX-NEXT: .seh_endproc
|
||||
top:
|
||||
tail call void asm sideeffect "", "~{xmm6},~{dirflag},~{fpsr},~{flags}"()
|
||||
@ -1043,8 +1031,6 @@ define double @clearence(i64 %arg) {
|
||||
; SSE-WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; SSE-WIN-NEXT: addq $168, %rsp
|
||||
; SSE-WIN-NEXT: retq
|
||||
; SSE-WIN-NEXT: .seh_handlerdata
|
||||
; SSE-WIN-NEXT: .text
|
||||
; SSE-WIN-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX-LABEL: clearence:
|
||||
@ -1104,8 +1090,6 @@ define double @clearence(i64 %arg) {
|
||||
; AVX-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; AVX-NEXT: addq $168, %rsp
|
||||
; AVX-NEXT: retq
|
||||
; AVX-NEXT: .seh_handlerdata
|
||||
; AVX-NEXT: .text
|
||||
; AVX-NEXT: .seh_endproc
|
||||
top:
|
||||
tail call void asm sideeffect "", "~{xmm6},~{dirflag},~{fpsr},~{flags}"()
|
||||
@ -1416,8 +1400,6 @@ define void @loopclearance2(double* nocapture %y, i64* %x, double %c1, double %c
|
||||
; SSE-WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; SSE-WIN-NEXT: addq $152, %rsp
|
||||
; SSE-WIN-NEXT: retq
|
||||
; SSE-WIN-NEXT: .seh_handlerdata
|
||||
; SSE-WIN-NEXT: .text
|
||||
; SSE-WIN-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX1-LABEL: loopclearance2:
|
||||
@ -1499,8 +1481,6 @@ define void @loopclearance2(double* nocapture %y, i64* %x, double %c1, double %c
|
||||
; AVX1-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; AVX1-NEXT: addq $152, %rsp
|
||||
; AVX1-NEXT: retq
|
||||
; AVX1-NEXT: .seh_handlerdata
|
||||
; AVX1-NEXT: .text
|
||||
; AVX1-NEXT: .seh_endproc
|
||||
;
|
||||
; AVX512VL-LABEL: loopclearance2:
|
||||
@ -1582,8 +1562,6 @@ define void @loopclearance2(double* nocapture %y, i64* %x, double %c1, double %c
|
||||
; AVX512VL-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Reload
|
||||
; AVX512VL-NEXT: addq $152, %rsp
|
||||
; AVX512VL-NEXT: retq
|
||||
; AVX512VL-NEXT: .seh_handlerdata
|
||||
; AVX512VL-NEXT: .text
|
||||
; AVX512VL-NEXT: .seh_endproc
|
||||
entry:
|
||||
tail call void asm sideeffect "", "~{xmm7},~{dirflag},~{fpsr},~{flags}"()
|
||||
|
@ -124,8 +124,6 @@ define void @f_non_leaf(i32 %x, i32 %y) !prof !14 {
|
||||
; WIN64-NEXT: jmp bar # TAILCALL
|
||||
; WIN64-NEXT: # encoding: [0xeb,A]
|
||||
; WIN64-NEXT: # fixup A - offset: 1, value: bar-1, kind: FK_PCRel_1
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
entry:
|
||||
; Force %ebx to be spilled on the stack, turning this into
|
||||
|
@ -124,8 +124,6 @@ define void @f_non_leaf(i32 %x, i32 %y) optsize {
|
||||
; WIN64-NEXT: jmp bar # TAILCALL
|
||||
; WIN64-NEXT: # encoding: [0xeb,A]
|
||||
; WIN64-NEXT: # fixup A - offset: 1, value: bar-1, kind: FK_PCRel_1
|
||||
; WIN64-NEXT: .seh_handlerdata
|
||||
; WIN64-NEXT: .text
|
||||
; WIN64-NEXT: .seh_endproc
|
||||
entry:
|
||||
; Force %ebx to be spilled on the stack, turning this into
|
||||
|
@ -15,7 +15,6 @@ entry:
|
||||
; CHECK: .seh_proc use_gxx_seh
|
||||
; CHECK-NOT: .seh_handler __gxx_personality_seh0
|
||||
; CHECK: callq throwit
|
||||
; CHECK: .seh_handlerdata
|
||||
; CHECK: .seh_endproc
|
||||
|
||||
define void @use_gcc_seh()
|
||||
@ -29,6 +28,5 @@ entry:
|
||||
; CHECK: .seh_proc use_gcc_seh
|
||||
; CHECK-NOT: .seh_handler __gcc_personality_seh0
|
||||
; CHECK: callq throwit
|
||||
; CHECK: .seh_handlerdata
|
||||
; CHECK: .seh_endproc
|
||||
|
||||
|
@ -135,8 +135,6 @@ define dso_local void @test_null_arg(%struct.Foo* %f) {
|
||||
; ALL-NEXT: nop
|
||||
; ALL-NEXT: addq $40, %rsp
|
||||
; ALL-NEXT: retq
|
||||
; ALL-NEXT: .seh_handlerdata
|
||||
; ALL-NEXT: .text
|
||||
; ALL-NEXT: .seh_endproc
|
||||
entry:
|
||||
call void @test_noop1(%struct.Foo* %f, i32 addrspace(270)* null)
|
||||
|
@ -236,8 +236,6 @@ define void @f_thunk(i8* %this, ...) {
|
||||
; WINDOWS-NEXT: popq %rsi
|
||||
; WINDOWS-NEXT: popq %r14
|
||||
; WINDOWS-NEXT: rex64 jmpq *%rax # TAILCALL
|
||||
; WINDOWS-NEXT: .seh_handlerdata
|
||||
; WINDOWS-NEXT: .text
|
||||
; WINDOWS-NEXT: .seh_endproc
|
||||
;
|
||||
; X86-NOSSE-LABEL: f_thunk:
|
||||
|
@ -54,8 +54,6 @@ define void @pass_double(double* %p) {
|
||||
; CHECK-NEXT: nop
|
||||
; CHECK-NEXT: addq $40, %rsp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%v = load double, double* %p
|
||||
call void @take_double(double %v)
|
||||
@ -73,8 +71,6 @@ define void @pass_float(float* %p) {
|
||||
; CHECK-NEXT: nop
|
||||
; CHECK-NEXT: addq $40, %rsp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%v = load float, float* %p
|
||||
call void @take_float(float %v)
|
||||
@ -98,8 +94,6 @@ define void @call_double(double* %p) {
|
||||
; CHECK-NEXT: addq $32, %rsp
|
||||
; CHECK-NEXT: popq %rsi
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%v = call double @produce_double()
|
||||
store double %v, double* %p
|
||||
@ -120,8 +114,6 @@ define void @call_float(float* %p) {
|
||||
; CHECK-NEXT: addq $32, %rsp
|
||||
; CHECK-NEXT: popq %rsi
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%v = call float @produce_float()
|
||||
store float %v, float* %p
|
||||
|
@ -53,7 +53,6 @@ declare void @g(i32)
|
||||
; CHECK: .quad .LBB0_
|
||||
; CHECK: .quad .LBB0_
|
||||
; CHECK: .quad .LBB0_
|
||||
; CHECK: .seh_handlerdata
|
||||
|
||||
; It's important that we switch back to .text here, not .rdata.
|
||||
; CHECK: .text
|
||||
|
@ -13,8 +13,6 @@ define i32 @f1(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5) "frame-pointer"="all
|
||||
; CHECK-NEXT: movl 48(%rbp), %eax
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
ret i32 %p5
|
||||
}
|
||||
@ -37,8 +35,6 @@ define void @f2(i32 %p, ...) "frame-pointer"="all" {
|
||||
; CHECK-NEXT: addq $8, %rsp
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%ap = alloca i8, align 8
|
||||
call void @llvm.va_start(i8* %ap)
|
||||
@ -56,8 +52,6 @@ define i8* @f3() "frame-pointer"="all" {
|
||||
; CHECK-NEXT: movq 8(%rbp), %rax
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%ra = call i8* @llvm.returnaddress(i32 0)
|
||||
ret i8* %ra
|
||||
@ -77,8 +71,6 @@ define i8* @f4() "frame-pointer"="all" {
|
||||
; CHECK-NEXT: addq $304, %rsp # imm = 0x130
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
alloca [300 x i8]
|
||||
%ra = call i8* @llvm.returnaddress(i32 0)
|
||||
@ -103,8 +95,6 @@ define void @f5() "frame-pointer"="all" {
|
||||
; CHECK-NEXT: addq $336, %rsp # imm = 0x150
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%a = alloca [300 x i8]
|
||||
%gep = getelementptr [300 x i8], [300 x i8]* %a, i32 0, i32 0
|
||||
@ -128,8 +118,6 @@ define void @f6(i32 %p, ...) "frame-pointer"="all" {
|
||||
; CHECK-NEXT: addq $336, %rsp # imm = 0x150
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%a = alloca [300 x i8]
|
||||
%gep = getelementptr [300 x i8], [300 x i8]* %a, i32 0, i32 0
|
||||
@ -152,8 +140,6 @@ define i32 @f7(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) "frame-pointer"="all" {
|
||||
; CHECK-NEXT: leaq 176(%rbp), %rsp
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
alloca [300 x i8], align 64
|
||||
ret i32 %e
|
||||
@ -191,8 +177,6 @@ define i32 @f8(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) "frame-pointer"="all" {
|
||||
; CHECK-NEXT: popq %rsi
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%alloca = alloca [300 x i8], align 64
|
||||
alloca i32, i32 %a
|
||||
@ -213,8 +197,6 @@ define i64 @f9() {
|
||||
; CHECK-NEXT: popq %rax
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
entry:
|
||||
%call = call i64 @llvm.x86.flags.read.u64()
|
||||
@ -244,8 +226,6 @@ define i64 @f10(i64* %foo, i64 %bar, i64 %baz) {
|
||||
; CHECK-NEXT: popq %rbx
|
||||
; CHECK-NEXT: popq %rsi
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%cx = cmpxchg i64* %foo, i64 %bar, i64 %baz seq_cst seq_cst
|
||||
%v = extractvalue { i64, i1 } %cx, 0
|
||||
@ -266,8 +246,6 @@ define i8* @f11() "frame-pointer"="all" {
|
||||
; CHECK-NEXT: leaq 8(%rbp), %rax
|
||||
; CHECK-NEXT: popq %rbp
|
||||
; CHECK-NEXT: retq
|
||||
; CHECK-NEXT: .seh_handlerdata
|
||||
; CHECK-NEXT: .text
|
||||
; CHECK-NEXT: .seh_endproc
|
||||
%aora = call i8* @llvm.addressofreturnaddress()
|
||||
ret i8* %aora
|
||||
|
Loading…
Reference in New Issue
Block a user