This patch fixes a bug in stack save/restore code. Because the frame pointer was saved/restored manually (not by marking it as clobbered) the StackSize variable was not updated accordingly. Most code still worked, but code that tried to load a parameter passed on the stack did not.
This commit fixes this by marking the frame pointer as a callee-clobbered register. This will let it be saved without any effort in prolog/epilog code and will make sure the correct address is calculated for loading parameters that are passed on the stack.
This approach is used by most other targets (such as X86, AArch64 and RISC-V).
Note that in two of the tests (calling-conv/c/stack.ll and return.ll) the updated assembly looks a lot better, I think the code was buggy before. I find it hard to say that varargs.ll has been fixed, I'm not exactly sure what the code is doing. That said, this patch does get mulodi4_test.c (in compiler-rt) to pass so it definitely fixes a bug.