File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ bool X86WinEHUnwindV2::runOnMachineFunction(MachineFunction &MF) {
190190 State = FunctionState::FinishedEpilog;
191191 break ;
192192
193+ case X86::LEA64r:
193194 case X86::MOV64rr:
194195 case X86::ADD64ri32:
195196 if (State == FunctionState::InEpilog) {
@@ -210,7 +211,8 @@ bool X86WinEHUnwindV2::runOnMachineFunction(MachineFunction &MF) {
210211 HasStackDealloc = true ;
211212 } else if (State == FunctionState::FinishedEpilog)
212213 return rejectCurrentFunctionInternalError (
213- MF, Mode, " Unexpected mov or add instruction after the epilog" );
214+ MF, Mode,
215+ " Unexpected lea, mov or add instruction after the epilog" );
214216 break ;
215217
216218 case X86::POP64r:
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ body: |
106106# RUN: -x86-wineh-unwindv2-force-mode=1 | FileCheck %s \
107107# RUN: --check-prefix=BESTEFFORT
108108# DEALLOC-AFTER-EPILOG: LLVM ERROR: Windows x64 Unwind v2 is required, but LLVM has generated incompatible code in function 'dealloc_after_epilog':
109- # DEALLOC-AFTER-EPILOG-SAME: Unexpected mov or add instruction after the epilog
109+ # DEALLOC-AFTER-EPILOG-SAME: Unexpected lea, mov or add instruction after the epilog
110110
111111--- |
112112 define dso_local void @dealloc_after_epilog() local_unnamed_addr {
Original file line number Diff line number Diff line change @@ -152,6 +152,25 @@ entry:
152152; CHECK-NEXT: retq
153153; CHECK-NEXT: .seh_endproc
154154
155+ define dso_local void @large_aligned_alloc () align 16 {
156+ %1 = alloca [128 x i8 ], align 64
157+ ret void
158+ }
159+ ; CHECK-LABEL: large_aligned_alloc:
160+ ; CHECK: .seh_unwindversion 2
161+ ; CHECK: .seh_pushreg %rbp
162+ ; CHECK: .seh_stackalloc 176
163+ ; CHECK: .seh_setframe %rbp, 128
164+ ; CHECK: .seh_endprologue
165+ ; CHECK-NOT: .seh_endproc
166+ ; CHECK: .seh_startepilogue
167+ ; CHECK-NEXT: leaq 48(%rbp), %rsp
168+ ; CHECK-NEXT: .seh_unwindv2start
169+ ; CHECK-NEXT: popq %rbp
170+ ; CHECK-NEXT: .seh_endepilogue
171+ ; CHECK-NEXT: retq
172+ ; CHECK-NEXT: .seh_endproc
173+
155174declare void @a () local_unnamed_addr
156175declare i32 @b () local_unnamed_addr
157176declare i32 @c (i32 ) local_unnamed_addr
You can’t perform that action at this time.
0 commit comments