[PATCH] D46232: [SystemZ, IPRA] determineCalleeSaves must always add return register and DP.

Vivek Pandya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 29 06:39:56 PDT 2018


vivekvpandya added a comment.

> When enabling IPRA on SystemZ, a benchmark crashed and I found out that a function had been optimized to not save the Callee Saved Registers, which unfortunately included the return register (%r14) on SystemZ, so when the function tried to return UB resulted.

Why the caller function did not save/restore return register value around when for a callee IPRA decided to have noCSR opt? 
Also I think there should be other architecture for which also these tests will break due to same reason. If this is bug applicable for other architectures too then I think it is better to update TargetFrameLowering::determineCalleeSaves() so that it can add such specially treated registers to saved list or other architecture must update their determineCalleeSaves() as implemented in this change.

> To fix this, I beleive SystemZFrameLowering::determineCalleeSaves() needs to add R14D to SavedRegs. I also think the DP should be added (https://reviews.llvm.org/source/libunwind/), in case the calling function uses DP, right?

I see determineCalleeSaves() implementation for few other architectures and none of them checking if IPRA is enable so are they handling such case in different way or they are unaware of this kind of failure?


https://reviews.llvm.org/D46232





More information about the llvm-commits mailing list