[PATCH] D31908: [AntiDepBreaker] Don't rename callee saved register restore instruction

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 14:55:41 PDT 2017


Carrot added a comment.

In https://reviews.llvm.org/D31908#741341, @kparzysz wrote:

> We add all callee saved registers as live-in on all paths from the restores to the exit, so this problem shouldn't affect us.  Actually the anti-dep breaker was the reason why we did it in the first place.


The second loop in function AggressiveAntiDepBreaker::StartBlock tries to do the work you described. Unfortunately it doesn't work with shrink wrapping. It says:

// Mark live-out callee-saved registers. In a return block this is
// all callee-saved registers. In non-return this is any
// callee-saved register that is not saved in the prolog.

1 The function MFI.getPristineRegs(MF) gets all registers actually saved in the function, not necessary at the prolog position if shrink wrapping has occurred.
2 If the register restore instructions are moved to non-return BB, the logic should be same as return block, then the logic in the code is wrong.

Any suggestions on how to fix it?


https://reviews.llvm.org/D31908





More information about the llvm-commits mailing list