[PATCH] D36160: Liveness issues in tail merging, and the ARM::LR saved-but-not-restored

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 09:37:36 PDT 2017


kparzysz added a comment.

In https://reviews.llvm.org/D36160#828176, @efriedma wrote:

> The point I was trying to make is that we should always exclude LR from the set of registers added by addLiveOutsNoPristines: whether or not we actually convert the "bx lr" into a "pop", it isn't live out of the function, and we don't need to model it that way.  So assignCalleeSavedSpillSlots wouldn't need any special logic to figure that out.


If we remove LR from CSI in assignCalleeSavedSpillSlots, it won't be saved, and the updateLiveness function won't add it to block live-ins.  On the other hand, if LR remains in CSI, addLiveOutsNoPristines will add it to the set it returns.  At the moment BX_RET is not marked as using LR, so that is not keeping LR live, when I add implicit use or LR to BX_RET, the verifier fails even before register allocation, since LR is not reserved and it expects the live-ins for LR to be correct from the start.


Repository:
  rL LLVM

https://reviews.llvm.org/D36160





More information about the llvm-commits mailing list