[PATCH] D42848: Correct dwarf unwind information in function epilogue
Francis Visoiu Mistrih via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 20 08:51:15 PDT 2018
thegameg added a comment.
I have some tests failing on my side:
Failing Tests (12):
LLVM :: CodeGen/X86/O3-pipeline.ll
LLVM :: CodeGen/X86/avoid-sfb.ll
LLVM :: CodeGen/X86/cmpxchg-i128-i1.ll
LLVM :: CodeGen/X86/fmaxnum.ll
LLVM :: CodeGen/X86/fminnum.ll
LLVM :: CodeGen/X86/fp-arith.ll
LLVM :: CodeGen/X86/mmx-arith.ll
LLVM :: CodeGen/X86/pr32241.ll
LLVM :: CodeGen/X86/pr32284.ll
LLVM :: CodeGen/X86/schedule-x86_32.ll
LLVM :: CodeGen/X86/vector-arith-sat.ll
================
Comment at: test/CodeGen/X86/avx512-regcall-Mask.ll:197
; LINUXOSX64-NEXT: addq $24, %rsp
-; LINUXOSX64-NEXT: .cfi_adjust_cfa_offset -16
+; LINUXOSX64-NEXT: .cfi_adjust_cfa_offset -24
; LINUXOSX64-NEXT: popq %r12
----------------
violetav wrote:
> thegameg wrote:
> > Hmm, I still don't really understand this change.
> I'll try to explain.
> Without CFI instructions in epilogue, merging would occur, but adjust_cfa_offset used to have wrong offset value set.
>
> Then, when CFI in epilogue were added, they prevented merging, and the situation was the following:
> ...
> callq test_argv64i1
> addq $16, %rsp
> .cfi_adjust_cfa_offset -16
> addq $8, %rsp
> .cfi_def_cfa_offset 40
> popq %r12
> .cfi_def_cfa_offset 32
> ...
>
> Now, CFI instruction, in this case the '.cfi_def_cfa_offset 40', doesn't prevent merging, and correct offset (24) is set to cfi_adjust_cfa directive.
> Merging and creating corresponding adjust_cfa_offset happens after emitEpilogue(), when cfi in epilogue are already inserted. Hope this helps clear things up a bit.
Oh yes! I assumed the test was correct before (rookie mistake), but your patch actually fixes this. Thanks for the explanation.
Repository:
rL LLVM
https://reviews.llvm.org/D42848
More information about the llvm-commits
mailing list