[PATCH] D92803: [SystemZFrameLowering] Make sure R1 holding the backchain is not corrupted by probing

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 00:56:16 PST 2020


uweigand added a comment.

I'm not sure I like the implicit assumptions the patch makes between inlineStackProbe and emitPrologue.

I think the code would be clearer if manipulation of the backchain were moved next to manipulation of r15.   That is to say, emitPrologue should only store the backchain in the case where it itself updates r15.  In the case where the r15 update happens in inlineStackProbe then storing the backchain should also happen in inlineStackProbe.

Then the code in inlineStackProbe can be self-contained and use r1 however it likes.  If it helps, the code might also want to use r0 as a second temporary register to hold the backchain value temporarily.  Also, strictly speaking the backchain ought to stored every time the stack pointer is updated, so it could be stored every time through the loop.  (Then the store would also implicitly serve as probe.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92803/new/

https://reviews.llvm.org/D92803



More information about the llvm-commits mailing list