[PATCH] Implement inalloca codegen for x86 with the new inalloca design

Reid Kleckner rnk at google.com
Fri Jan 31 15:37:50 PST 2014



================
Comment at: include/llvm/Support/CallSite.h:271
@@ -270,2 +270,3 @@
 
-  /// @brief Determine if there are any inalloca arguments.
+  /// @brief Determine if there are is an inalloca argument.  Only the last
+  /// argument can have the inalloca attribute.
----------------
Eric Christopher wrote:
> This could/should probably be verified by the IR verifier if it isn't already.
Yep, it is.

================
Comment at: lib/IR/Mangler.cpp:68
@@ -67,3 +67,3 @@
     Type *Ty = AI->getType();
-    // 'Dereference' type in case of byval parameter attribute
-    if (AI->hasByValAttr())
+    // 'Dereference' type in case of byval or inalloca parameter attribute
+    if (AI->hasByValOrInAllocaAttr())
----------------
Eric Christopher wrote:
> Period on the end of the sentence (yes, I know you didn't write it).
sure

================
Comment at: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:80
@@ +79,3 @@
+      // stack frame allocation, even if they are in the entry block.
+      if (!AI->isStaticAlloca())
+        continue;
----------------
Eric Christopher wrote:
> This is a general change in behavior for non-inalloca code and could probably use a test case.
Sure, but it will require inalloca, because that's the only way to get a non-static alloca here.

================
Comment at: lib/Target/X86/X86FastISel.cpp:2490
@@ -2485,2 +2489,3 @@
     return 0;
+  assert(C->isStaticAlloca() && "dynamic alloca in the static alloca map?");
 
----------------
Eric Christopher wrote:
> This also seems like it should be in a separate check-in similar to the one above that checks basically for the same thing.
sure


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



More information about the llvm-commits mailing list