[PATCH] D12337: [Codegen] Ensure stack is properly aligned for call argument initialization

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 14:46:44 PDT 2015

rnk added inline comments.

Comment at: include/llvm/CodeGen/CallingConvLower.h:274-279
@@ -272,4 +273,8 @@
-  unsigned getNextStackOffset() const { return StackOffset; }
+  /// getNextStackOffset - Return the stack offset needed to be able to store
+  /// all stack slots according to their alignment requirements.
+  unsigned getNextStackOffset() const {
+    return RoundUpToAlignment(StackOffset, MaxStackArgAlign);
+  }
   /// isAllocated - Return true if the specified register (or an alias) is
Yes, but here's the 32-bit test case I'm imagining:
  void f(__m128 v, const char *f, ...) {
    va_list ap;
    va_start(ap, f);
    int d = va_arg(ap, int);
Do we have padding between 'f' and the variadic int parameter? I think the answer should be know, because if they were not variadic, they would not have padding between them.


More information about the llvm-commits mailing list