Hello,
it seems the Prolog/Epilog insertion does not correctly align stack for me.
Consider the PEI::calculateFrameObjectOffsets method. It only aligns the
stack if
FFI->hasCalls()
is true. The only place where
MachineFrameInfo::setHasCalls
is invoked is
PEI::saveCallerSavedRegisters
and the value 'true' is only passed when there are instructions with opcodes
equal to either RegInfo->getCallFrameSetupOpcode() or
RegInfo->getCallFrameDestroyOpcode(). I don't have such special opcode, so
hasCalls returns false and the stack is not aligned.
Any ideas?
- Volodya
Hello,
it seems the Prolog/Epilog insertion does not correctly align stack for me.
Consider the PEI::calculateFrameObjectOffsets method. It only aligns the
stack if
FFI->hasCalls()
is true. The only place where
Yup, the idea is that you dno't need to align the outgoign stack for a
leaf function.
MachineFrameInfo::setHasCalls
is invoked is
PEI::saveCallerSavedRegisters
and the value 'true' is only passed when there are instructions with opcodes
equal to either RegInfo->getCallFrameSetupOpcode() or
RegInfo->getCallFrameDestroyOpcode(). I don't have such special opcode, so
hasCalls returns false and the stack is not aligned.
Okay, if you don't want to use this functionality, just call setHasCalls()
on the MFI in your instruction selector. That should prevent this from
happening on any functions.
-Chris