When a stack offset was too big to materialize in a single instruction, we were trying to do it in stages:
adds xD, sp, #imm adds xD, xD, #imm
Unfortunately, if xD is xzr then the second instruction (adds xzr, xzr, #imm) doesn't exist and wouldn't do what was needed if it did. Instead we can use a temporary register for all but the last addition.
If two adds are being emitted we should test for both of them, and it would be good to test the immediate values too.