[PATCH] D66013: [X86] Emit correct unwind info for split-stack prologue

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 12:37:27 PDT 2019


wmi added inline comments.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:192-196
+        if (RememberedReg == ~0u) {
+          RememberedReg = SetRegister;
+          RememberedOffset = SetOffset;
+          break;
+        }
----------------
wmi wrote:
> I feel it is not the correct meaning of .cfi_remember_state. .cfi_remember_state means remembering the current set of CFI rules so it is related with layout instead of function control flow. Here calculateOutgoingCFAInfo is based on function control flow. 
> 
> For allocMBB, the .cfi_remember_state remembers the state its prev MBB, not the state of its predecessor MBB, which is the function entry.
> 
> I think we should ignore .cfi_remember_state and .cfi_restore_state inside of calculateOutgoingCFAInfo because they are not directives associated with CFI changing machine instructions.
And handle .cfi_remember_state and .cfi_restore_state inside of insertCFIInstrs, when the outgoing cfi information of prev BB (not predecessor BB) is available. 


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66013/new/

https://reviews.llvm.org/D66013





More information about the llvm-commits mailing list