[PATCH] D13034: Do not mark CSRs as pristine in functions that have been shrink wrapped

Kit Barton via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 07:44:41 PDT 2015

kbarton added a comment.

In http://reviews.llvm.org/D13034#250216, @MatzeB wrote:

> Can you give some more context why this fails? I recently changed the PristineRegister definition to be independent of the place in the function so it wouldn't matter whether you are in the prologue or epilogue of the function. For the prologue/epilogue those saved CSRs should be marked as live-in values and therefore should be considered live by the RegisterScavenger/LivePhysRegs. Do you have an instance where this is not the case?

The attached test case demonstrates how this fails.
Shrink wrapping identifies a new location for the save/restore blocks. Callee-saved register R30 is then moved to be saved/restored outside of the prologue. Later in the compilation, during Aggressive Anti-Dependence breaking, R30 is chosen to be used to break an anti-dependence in a block *after* the restore location identified by shrink wrapping. This clobbers the value in R30.


More information about the llvm-commits mailing list