[PATCH] D33562: MachineLICM: Add new condition for hoisting of caller preserved registers

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 04:38:25 PDT 2017


nemanjai added a comment.

> You talk about a call instruction? Is X2 saved and restored in the called function? Then it's just a CSR and should not be mentioned in the clobber list so no problem with my proposal above.

But it is the caller that saves and restores it, not the callee. The sequence is essentially this (all in the caller of course):

- Save X2 to it's stack slot
- Update X2 prior to the call
- Call the function through a pointer
- Restore X2 immediately after the call


https://reviews.llvm.org/D33562





More information about the llvm-commits mailing list