[PATCH] D21259: don't force SP-relative addressing for statepoints when the offset is not statically known
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 14:00:46 PDT 2016
sanjoy added a comment.
In http://reviews.llvm.org/D21259#458739, @rnk wrote:
> Is it really necessary to prefer SP-relative offsets from FP-relative offsets? Is there any reason not to standardize on getFrameIndexReference? You can always get SP-relative offsets by disabling frame pointers.
> Assuming we need SP-relative offsets, I think it would be cleaner to expose an API on TargetFrameLowering that prefers returning SP-relative offsets if possible, rather than having an API that might fail. The base TargetFrameLowering implementation can delegate directly to getFrameIndexReference, and targets like X86 can implement the preference for SP-relative offsets.
We do want to prefer SP relative offsets, even when we're preserving frame pointers. But I like your second idea, I'll put up a patch for review soon.
More information about the llvm-commits