giving different answers in early/late phases of codegen.
The attached testcase shows a particular nasty example where we would call TargetRegisterInfo::needsStackRealignment()->canRealignStack()->hasReservedCallFrame() and would end up not aligning the stack because hasReservedCallFrame() would report false in late passes only.
This exposes a method in MachineFrameInfo that calculates
MaxCallFrameSize and calls it after instruction selection to get the value computed early.
To make this work in GlobalISel this also:
- Move the TargetLoweringInfo::finalizeLowering code from IRTranslator to the end of InstructionSelect
- Changing the MachineVerifier to work when the reserved registers are not frozen yet (by using TargetRegisterInfo::getReservedRegs() instead of MachineRegisterInfo stuff).