[PATCH] AAPCS: Cannot split argument between GPRs and the stack after a CPRC has been allocated to the stack

Renato Golin renato.golin at linaro.org
Wed Feb 12 01:34:59 PST 2014



================
Comment at: lib/CodeGen/TargetInfo.cpp:3481
@@ -3457,1 +3480,3 @@
+    // the stack.
+    AllocatedVFP = 17;
     return;
----------------
Oliver Stannard wrote:
> Renato Golin wrote:
> > Oliver Stannard wrote:
> > > Renato Golin wrote:
> > > > Why are you saturating? Is there any place that especially check against 17? Or are all of them like this, >=16?
> > > On line 3336, we check whether AllocatedVFP > 16, as we need to know whether some CPRCs have been allocated on the stack.
> > Shouldn't we just change that check, then? I think it makes more sense.
> This can't be done just by changing the check.
> 
> Without the line "AllocatedVFP = 17;", AllocatedVFPs will be set to 16 for the following two cases:
>  * 8 doubles - exactly fills the VFP registers
>  * 9 doubles - fills the VFP registers with no gaps, plus one double on the stack
> 
> However, we need to differentiate between the two cases, as in the first we can split a struct between the GPRs and stack, but in the second case we cannot. (AAPCS rule C.5)
> 
> Because of this, I am using (AllocatedVFPs > NumVFPs) to signify that at least one CPRC has been allocated to the stack, and the same with AllocatedGPRs. Once AllocatedVFPs > NumVFPs, we don't actually need to track the exact number of bytes used on the stack, only that this is non-zero.
Right, ok, makes sense. LGTM.


http://llvm-reviews.chandlerc.com/D2726



More information about the cfe-commits mailing list