[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
Sun Feb 9 08:54:13 PST 2014


  Hi Oliver,

  Overall, looks good. I'm not particularly confident in this area, so would be good if someone else more experienced with Clang could take a look.

  I have some comments below.

  cheers,
  --renato


================
Comment at: lib/CodeGen/TargetInfo.cpp:3481
@@ -3457,1 +3480,3 @@
+    // the stack.
+    AllocatedVFP = 17;
     return;
----------------
Why are you saturating? Is there any place that especially check against 17? Or are all of them like this, >=16?

================
Comment at: lib/CodeGen/TargetInfo.cpp:3670
@@ -3597,2 +3669,3 @@
     SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64;
+    markAllocatedGPRs(AllocatedGPRs, 2, SizeRegs * 2);
   }
----------------
Why SizeRegs * 2? Wouldn't they be 8-byte aligned anyway?

================
Comment at: lib/CodeGen/TargetInfo.cpp:3511
@@ +3510,3 @@
+/// this represents arguments being stored on the stack.
+static void markAllocatedGPRs(unsigned &AllocatedGPRs, unsigned Alignment,
+                              unsigned NumRequired) {
----------------
Couldn't this be a private method of ARMABIInfo and use AllocatedGPRs as a private member? It'd avoid passing it on all functions, but would only work if you can't have more than one context at a time. You'd also have to clear it, if you can re-use the class.


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



More information about the cfe-commits mailing list