[PATCH] [PATCH] Fix for http://llvm.org/bugs/show_bug.cgi?id=19905

Vadim Chugunov vadimcn at gmail.com
Fri Jun 6 19:06:55 PDT 2014


Hi Sanjay,
Please take a look at my preliminary patch to support Win64 SEH I've put here: http://reviews.llvm.org/D4053 (specifically stuff in X86FrameLowering()).   Not directly related to 19905, however, it touches the same code, and could benefit from the same refactoring.

Firstly, I think that spill slots will have to go into fixed frame slots, because in order to describe them in terms of Win64 SEH directives, the spilled XMM registers need to be addressable from the base pointer.   Right now they end up on the wrong side of the "stack realignment gap" in cases when stack is realigned.

Also, as I was working on this code, a couple of questions popped in my mind:
1. Why does PrologueEpilogueInserter pre-assign spill slots to registers before calling spillCalleeSavedRegisters?   Wouldn't it be more logical to let spillCalleeSavedRegisters do that (only if it is going to return true, of course).
2. Wouldn't it make sense to move the actual emission of PUSHes and MOVs into emitPrologue?   I think this would make CFI/SEH info generation much more straightforward.  spillCalleeSavedRegisters would still have to assign the spill slots, of course.   The only downside I see, is that this code wouldn't be able to use TII.storeRegToStackSlot(), because by that point frame slots have already been reified.

http://reviews.llvm.org/D4052






More information about the llvm-commits mailing list